Lint performance blog post and diagnostic tool

442 views
Skip to first unread message

Matthew Gharrity

unread,
Apr 12, 2019, 2:44:56 PM4/12/19
to lint-dev
Today we published a blog post discussing some of the Lint performance improvements that landed with Studio 3.3.
https://medium.com/androiddevelopers/android-studio-project-marble-lint-performance-8baedbff2521

The post also introduces an open source tool we made to help pinpoint performance bottlenecks in individual Lint detectors.

The tool uses bytecode instrumentation to implement per-Lint-detector performance attribution when running Lint from Gradle. We made it mostly for internal use, but feel free to check it out! In particular, if you have a large number of custom Lint checks, you may find the tool helpful in diagnosing which ones are slowing down your builds (if any). You can also use the tool to give us additional information when filing Lint performance bug reports :-)

Here's some sample output from the tool running on a Hello World style project.

$ ./gradlew lintDebug -no-daemon -Dorg.gradle.jvmargs="..."

BUILD SUCCESSFUL in 10s
15 actionable tasks: 1 executed, 14 up-to-date

Lint detector performance stats:
                                     total           self          calls
                 LintDriver        3709 ms        1302 ms           2821
TopDownAnalyzerFacadeForJVM        2121 ms        2121 ms              6
               IconDetector          81 ms          81 ms            257
           OverdrawDetector          51 ms          51 ms             36
     InvalidPackageDetector          34 ms          34 ms          51744
             GradleDetector          20 ms          20 ms             94
       LocaleFolderDetector          11 ms          11 ms            986
         RestrictToDetector          11 ms          11 ms             19
                ApiDetector          11 ms          11 ms           1255
    PrivateResourceDetector          10 ms          10 ms            422
                      [...]
Reply all
Reply to author
Forward
0 new messages