Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

[question/idea] Reusing analysis information in multi-module project #16

Closed
lqc opened this issue Oct 22, 2017 · 3 comments
Closed

[question/idea] Reusing analysis information in multi-module project #16

lqc opened this issue Oct 22, 2017 · 3 comments

Comments

@lqc
Copy link

lqc commented Oct 22, 2017

I have a fairly large project where the whole analysis can take several minutes. The project is split into Maven modules (some small, some large). Currently, the analysis is triggered separately for each project (that's how the gradle plugin works as well, AFAIK) with the classes for that project as "classes" and all it's dependencies as "auxclasspath".

I didn't do any benchmarks yet, but my intuition tells me that at least some of the effort is repeated. I'm not also sure if this is the correct way to do it, i.e. would analyzing all the projects in one go yield more accurate results then one by one ?

Another common case is that running the analysis with the same set of dependecies (you don't upgrade your libraries every day).

In both cases, I think it would be possible to reuse some of the data gathered in previous analysis as long as the "auxclasspath" did not change.

Do you think it's an idea worth exploring?

@mebigfatguy
Copy link

You could certainly investigate caching the first (or preliminary) passes of split pass detectors. At least the collection of information for aux classes. It probably wouldn't be too much of a disaster to prototype that. Unfortunately, the large percentage of the time is not in this first pass collection. So i'm not sure putting in all that work would in the end give you the bang for the buck you were hoping for.

@lqc
Copy link
Author

lqc commented Oct 22, 2017

Well, I measured this on a small project and the first pass takes 11s out of 34s total. The app to referenced classses ratio is about 1:2, so I guess I could cut this down to 4s and (in theory) have it run 20% faster. In case of an IDE plugin, this could be used to skip a large chunk of the first pass when only a few classes are rebuilt.

@lqc lqc closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
@lasselindqvist
Copy link

While not planned in Spotbugs itself, you might want to check out https://maven.apache.org/extensions/maven-build-cache-extension/index.html if this is still relevant to you or anyone else looking for a solution to this. That said, I do not have a ready-made example on how to cache the results of Spotbugs Maven plugin correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants