This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I think these could easily be much more optimized. See thread dumps showing slow behavior while typing in the editor. Many of the snapshots are the fault of issue #41658 but some are in J2SELibraryClassPathProvider or PlatformClassPathProvider.
Created attachment 14266 [details] Selected thread dumps showing activity in ClassPath.getClassPath not due to apisupport/project
Note that it appears that ClassPath.getClassPath is getting called *after every keystroke*, not just after the 3-seconds grace delay that used to be the case in the editor. I am not sure why the editor is doing this, but it magnifies the performance problem greatly. I am assuming that it has something to do with code folding. In fact if I turn off code folding and restart, editor performance seems markedly better.
Agree, the ClassPath should be cached. When I have written it, I've expected that the client will cache the classpath.
There is not much to do in the ClassPathProviders. The provider only checks if the file is in some platform/library. The performance should be improved when the ClassPathProviders will be ordered in the lookup [Project/Platform/Library]. The most of queries are for project source files, the library and platform ClassPathProvider provides ClassPath only for the jdk/library sources. I can also add some caching of last n queries. Probably n=1. But I would do it only if the ordering will not help.
Agreed, if lookup ordering is implemented this may be a P4.
The ClassPathProviders are ordered. 100) Project ClassPath Provider 150) JDK ClassPath Provider 150) Libraries ClassPath Provider This should help. I am also going to add an simple cache into JDK and Libraries CPProviders.
Checking in java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibraryClassPathProvider.java; /cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibraryClassPathProvider.java,v <-- J2SELibraryClassPathProvider.java new revision: 1.4; previous revision: 1.3 done Checking in java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceForBinaryQuery.java; /cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceForBinaryQuery.java,v <-- J2SELibrarySourceForBinaryQuery.java new revision: 1.5; previous revision: 1.4 done Checking in java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/JavadocForBinaryQueryLibraryImpl.java; /cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/JavadocForBinaryQueryLibraryImpl.java,v <-- JavadocForBinaryQueryLibraryImpl.java new revision: 1.4; previous revision: 1.3 done Checking in java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/ParserDBQueryLibraryImpl.java; /cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/ParserDBQueryLibraryImpl.java,v <-- ParserDBQueryLibraryImpl.java new revision: 1.4; previous revision: 1.3 done Processing log script arguments... More commits to come... Checking in java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/Util.java; /cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/Util.java,v <-- Util.java new revision: 1.10; previous revision: 1.9 done Processing log script arguments... More commits to come... Checking in form/src/org/netbeans/modules/form/resources/absolutelayout.xml; /cvs/form/src/org/netbeans/modules/form/resources/absolutelayout.xml,v <-- absolutelayout.xml new revision: 1.4; previous revision: 1.3 done Processing log script arguments... More commits to come... Checking in jellytools/modulesrc/org/netbeans/modules/jellytools/jelly2-library.xml; /cvs/jellytools/modulesrc/org/netbeans/modules/jellytools/jelly2-library.xml,v <-- jelly2-library.xml new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... Checking in jemmy/modulesrc/org/netbeans/modules/jemmy/library.xml; /cvs/jemmy/modulesrc/org/netbeans/modules/jemmy/library.xml,v <-- library.xml new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... Checking in junit/src/org/netbeans/modules/junit/resources/junit_lib.xml; /cvs/junit/src/org/netbeans/modules/junit/resources/junit_lib.xml,v <-- junit_lib.xml new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... Checking in web/jstl11/src/org/netbeans/modules/web/jstl11/jstl11.xml; /cvs/web/jstl11/src/org/netbeans/modules/web/jstl11/jstl11.xml,v <-- jstl11.xml new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... Checking in web/project/src/org/netbeans/modules/web/project/ui/resources/copyfiles.xml; /cvs/web/project/src/org/netbeans/modules/web/project/ui/resources/copyfiles.xml,v <-- copyfiles.xml new revision: 1.2; previous revision: 1.1 done Processing log script arguments... More commits to come... Checking in web/servletapi23/src/org/netbeans/modules/servletapi23/servlet23.xml; /cvs/web/servletapi23/src/org/netbeans/modules/servletapi23/servlet23.xml,v <-- servlet23.xml new revision: 1.2; previous revision: 1.1 done Processing log script arguments... More commits to come... Checking in web/servletapi24/src/org/netbeans/modules/servletapi24/jsp20.xml; /cvs/web/servletapi24/src/org/netbeans/modules/servletapi24/jsp20.xml,v <-- jsp20.xml new revision: 1.5; previous revision: 1.4 done Checking in web/servletapi24/src/org/netbeans/modules/servletapi24/servlet24.xml; /cvs/web/servletapi24/src/org/netbeans/modules/servletapi24/servlet24.xml,v <-- servlet24.xml new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... Checking in xtest/modulesrc/org/netbeans/modules/xtest/nb-junit-library.xml; /cvs/xtest/modulesrc/org/netbeans/modules/xtest/nb-junit-library.xml,v <-- nb-junit-library.xml new revision: 1.5; previous revision: 1.4 done