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.

Bug 41659 - Inefficiencies in ClassPathProvider impls for libs + platforms
Summary: Inefficiencies in ClassPathProvider impls for libs + platforms
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Classpath (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on: 41606
Blocks: 41535
  Show dependency tree
 
Reported: 2004-04-03 01:03 UTC by Jesse Glick
Modified: 2004-08-13 12:11 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Selected thread dumps showing activity in ClassPath.getClassPath not due to apisupport/project (41.04 KB, text/plain)
2004-04-03 01:08 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-04-03 01:03:52 UTC
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.
Comment 1 Jesse Glick 2004-04-03 01:08:10 UTC
Created attachment 14266 [details]
Selected thread dumps showing activity in ClassPath.getClassPath not due to apisupport/project
Comment 2 Jesse Glick 2004-04-03 01:14:16 UTC
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.
Comment 3 Tomas Zezula 2004-05-05 07:49:03 UTC
Agree, the ClassPath should be cached. When I have written it, I've
expected that the client will cache the classpath.
Comment 4 Tomas Zezula 2004-05-05 13:15:31 UTC
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.
Comment 5 Jesse Glick 2004-05-05 19:30:48 UTC
Agreed, if lookup ordering is implemented this may be a P4.
Comment 6 Tomas Zezula 2004-05-26 15:02:52 UTC
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.
Comment 7 Tomas Zezula 2004-05-27 09:52:47 UTC
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