Refactoring: Improve listClassPathHints() performance by mbien · Pull Request #8948 · apache/netbeans (original) (raw)

The binary class path Set has the tendency to have duplicated roots. The added deduplication pass ensures that findSourceRoots2 isn't called more often than necessary.

This can significantly improve the performance during code inspect and transform actions, esp when many projects are open.

relative time spent in listClassPathHints() during inspect/transform dialog open.

before:
image

after:
image

benchmark was a project wide code inspection run with all 856 NetBeans modules open.
listClassPathHints() execution time in ms

before:

after:

the number of entries was reduced from 154997 to 1258 in that use case.