#1243 [patch] Performance improvement for JSR305 analysis with big inheritance hierarchies

3.0.0
closed-fixed
patch (11)
5
2014-06-20
2014-01-18
Tobias Baum
No

As FindBugs is currently on the critical chain of our CI build, I did some profiling, which showed that a lot of time is spent in Subtypes2.traverseSupertypes, which is called for JSR305 analysis. This method implements a quite complex algorithm that visits every PATH in the supertype hierarchy. I could not see any reason in the JSR305 code why a simple depth first traversal of every supertype node shouldn't be sufficient. I implemented this as a patch, which gave me a speedup from 3:30 min to 3:00 min for the analysis of our codebase. You can pull my changes from https://code.google.com/r/tbaum-findbugs/

Some further notes:
- I did this change without fully understanding the JSR305 code, so perhaps I missed something. But the unit tests gave the same results before and after, and analysis of our codebase did so, too.
- According to Eclipse, there are no users of Subtypes2.traverseSupertypes left, so perhaps it could be deleted. I kept it anyway and made a new method (and interface) for the changes to keep compatibility with third party plugins.
- We have quite complex interface inheritance hierarchies in some of our generated code, which is probably why this is a performance problem for us (and most of the world was fine with the old implementation).

And finally the formal pull request generated by TortoiseGit:
The following changes since commit 387670322ff17cbc3c38ac932032787905d2ff40:

Change jsr305/Analysis to more efficient traversal (2014-01-18 17:39:02 +0100)

are available in the git repository at:

https://code.google.com/r/tbaum-findbugs/ master

for you to fetch changes up to 387670322ff17cbc3c38ac932032787905d2ff40:

Change jsr305/Analysis to more efficient traversal (2014-01-18 17:39:02 +0100)

----------------------------------------------------------------

Discussion

    • Group: 2.0.4 --> 3.0.1
     
    • labels: --> patch
    • summary: Performance improvement for JSR305 analysis with big inheritance hierarchies --> [patch] Performance improvement for JSR305 analysis with big inheritance hierarchies
    • assigned_to: Andrey Loskutov
     
    • status: open --> closed-fixed
    • Group: 3.x --> 3.0.0