mbien opened a new pull request, #8524: URL: https://github.com/apache/netbeans/pull/8524
By assuming that most code is used, we can focus on the scenario where an Element is used in a package local file and cache it. This avoids having to repeatedly scan the package for usage. The not-used case is not cached, this allows a much simpler impl. + main change is in `UnusedDetector` + second commit is for cleanup in `SemanticHighlighterBase` and related files, some logging improvements before: ``` INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 2,431 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:5c29964c INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 2,709 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:5c29964c INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 1,913 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:5c29964c INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 1,967 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:5c29964c INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 2,530 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:5c29964c ``` after: ``` INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 793 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:44f9b9b INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 412 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:44f9b9b INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 80 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:44f9b9b INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 136 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:44f9b9b INFO [org.netbeans.modules.java.editor.semantic.SemanticHighlighter]: Semantic 78 netbeans/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java@f8531b5d:44f9b9b ``` test case is [`RepositoryUpdater.java`](https://github.com/apache/netbeans/blob/master/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java); each log event is a code modification. Performance improves once caches fill. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists