Thx for the tips Tor.Though, instead of using lint on the leaf module and checking dependencies, it looks like we would have better performances if each module could be analyzed and if this analysis could be cached. It should not be very complicated to check that things have not changed and that lint output should be the same. This is really a feature that that would help reducing build times, especially on CI.I am not asking for incrementality of lint, which would actually rock but is hard to achieve, but caching is definitely needed and **it's not hard to achieve**.
Running `lint` - 6 mins
nearly all the time both cores are used
Running `:app:lintRelease:` with checkDependencies enabled - 3 mins 18 sec
Only one core is used.
Removing checks on tests only gave us 3 extra seconds (it's not a project with a lot of unit tests really, it may be more relevant on other projects).
Data from Gradle Scans.
It's the opposite approach of what I "wanted", running it by modules so I can paralelize and take advantage of BuildCache to run only analysis on what changed...but the results are quite good so I can't really complain.
Is it ignoreTestSources only on AGP 3.2+ ?
(Just saying because I see it complains in AGP 3.1.3)
---------------------------------------Give lint a lot of RAM---------------------------------------This one is kind of obvious, but lint (especially the code analysis part) is really memory hungry; it does a lot of the same work as a compiler, except that it also hangs on to a lot more data (e.g. the full ASTs with whitespace and comments etc). Explore bumping up the memory given to the Gradle daemon significantly to see if it helps bring down the overall analysis time.This is *especially* important if you happen to run many lint jobs in parallel! If you follow the first advice above (where you're running a single lint job with recursive dependencies on the app module) this is less likely to happen, but I've seen various thread dumps from users asking about performance where there was 16-20 concurrent separate lint jobs running in the Gradle daemon, and each one requires a lot of memory; these separate lint job threads are not sharing data.
About "checkDependencies true", for 'normal' apps often there is a single 'app' leaf module. What if you have multiple (say 5) leaf modules that depend on one single library module? Will "checkDependencies true" cause lint to run five times for the library module?
--
You received this message because you are subscribed to the Google Groups "lint-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+u...@googlegroups.com.
To post to this group, send email to lint...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lint-dev/8340c428-2cf4-48a2-8303-31a56ee0fbc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
About "checkDependencies true", for 'normal' apps often there is a single 'app' leaf module. What if you have multiple (say 5) leaf modules that depend on one single library module? Will "checkDependencies true" cause lint to run five times for the library module?
Yes. That's why (with quite a bit of hesitation) I added the checkDependencies flag and turned it off by default (the recursive analysis used to be how it always behaved). It helps performance in deeply nested projects with lots and lots of multiply reused libraries. But it does have the downside of less accurate analysis in the context of the app (when a library is analyzed on its own, we don't know the true minSdkVersion, targetSdkVersion, compileSdkVersion, permissions available, resources consumed elsewhere, etc etc).-- Tor
--
You received this message because you are subscribed to the Google Groups "lint-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+u...@googlegroups.com.
To post to this group, send email to lint...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lint-dev/06169137-3314-46fa-a441-1beef04d5e43%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+u...@googlegroups.com.
To post to this group, send email to lint...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lint-dev/06169137-3314-46fa-a441-1beef04d5e43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "lint-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+u...@googlegroups.com.
To post to this group, send email to lint...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lint-dev/463a0798-175f-4f52-b6c1-40bacc4a7848%40googlegroups.com.
With the new performance improvement, does it require specific version of gradle?
Is it now better to use checkDependencies and only run lint on the app module, or is it still more performant to run lint on everything individually with checkDependencies off?
On Fri, Dec 7, 2018 at 10:50 AM gleach via lint-dev <lint...@googlegroups.com> wrote:With the new performance improvement, does it require specific version of gradle?Yes, 3.4.0-alpha07. We're also cherrypicking it back to an upcoming 3.3 RC.
Is it now better to use checkDependencies and only run lint on the app module, or is it still more performant to run lint on everything individually with checkDependencies off?There's no change there (there are tradeoffs depending on the shape of your module graph.)
Hey Tor,Has the idea of forking the lint process out of the gradle daemon been explored? Especially with the new Gradle 5.0 heap defaults, it seems like Gradle might be wanting to push more processing out of the daemon process itself. If that happened, it'd be a great way to be able to give the lint process more memory via it's own jvm args.
---------------------------------------Give lint a lot of RAM---------------------------------------This one is kind of obvious, but lint (especially the code analysis part) is really memory hungry; it does a lot of the same work as a compiler, except that it also hangs on to a lot more data (e.g. the full ASTs with whitespace and comments etc). Explore bumping up the memory given to the Gradle daemon significantly to see if it helps bring down the overall analysis time.This is *especially* important if you happen to run many lint jobs in parallel! If you follow the first advice above (where you're running a single lint job with recursive dependencies on the app module) this is less likely to happen, but I've seen various thread dumps from users asking about performance where there was 16-20 concurrent separate lint jobs running in the Gradle daemon, and each one requires a lot of memory; these separate lint job threads are not sharing data.
Thanks for all the suggestions. Our lint performance is pretty poor at the moment, so I'm going to try out several of these ideas and see what works.
Another idea we've been discussing internally is to just run lint on the files that have changed since the last build on our CI environment. It seems like lint only support exclusions (via the ignore element); no direct support for including files. But I thought I might be able to dynamically generate a lint.xml that essentially excludes everything except the files that have been modified. Before I attempt this, I wanted to get your thoughts on whether this would work. Is it practical, or does the nature of lint's work not really lend itself to running incrementally?
Thanks for the prompt reply Tor. And yes, I'm evaluating AGP 3.3.0 - it is indeed substantially faster than AGP 3.2.1. However, we are running into the "Lint infrastructure errors" described below, about 40% of the time:I see that these issues have been resolved, and are being backported to 3.3.x - can you share any information around when these fixes might land in a potential AGP 3.3.1 release? I hesitate to upgrade to an alpha/beta 3.4 release in our CI environment.
I see that these issues have been resolved, and are being backported to 3.3.x - can you share any information around when these fixes might land in a potential AGP 3.3.1 release? I hesitate to upgrade to an alpha/beta 3.4 release in our CI environment.It looks like the release is imminent (but as always, the brake can be pulled at the last minute etc etc so this is not a promise or a commitment). I'll ping this thread when it goes out.