Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 64166 Details for
Bug 161175
JarPackageFragmentRoot slow to initialize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and performance test
161175.txt (text/plain), 3.61 KB, created by
Jerome Lanneluc
on 2007-04-18 07:55:20 EDT
(
hide
)
Description:
Proposed fix and performance test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-04-18 07:55:20 EDT
Size:
3.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.performance >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java,v >retrieving revision 1.23 >diff -u -r1.23 FullSourceWorkspaceModelTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 2 Apr 2007 07:28:54 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 18 Apr 2007 11:55:11 -0000 >@@ -854,6 +854,48 @@ > } > } > >+/* >+ * Performance test for the first use of findType(...) >+ * (see bug 161175 JarPackageFragmentRoot slow to initialize) >+ */ >+public void testFindType() throws CoreException { >+ // get 20 projects >+ IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); >+ IJavaProject[] allProjects = model.getJavaProjects(); >+ int max = 20; >+ IJavaProject[] projects = new IJavaProject[max]; >+ int index = 0; >+ for (int i = 0, length = allProjects.length; i < length; i++) { >+ if (allProjects[i].getElementName().startsWith("org.eclipse")) { >+ projects[index++] = allProjects[i]; >+ if (index == max) >+ break; >+ } >+ } >+ >+ // warm up >+ for (int i = 0; i < 5; i++) { >+ model.close(); >+ for (int j = 0; j < max; j++) { >+ projects[j].findType("java.lang.Object"); >+ } >+ } >+ >+ // measure performance >+ for (int i = 0; i < 10; i++) { >+ model.close(); >+ runGc(); >+ startMeasuring(); >+ for (int j = 0; j < max; j++) { >+ projects[j].findType("java.lang.Object"); >+ } >+ stopMeasuring(); >+ } >+ >+ commitMeasurements(); >+ assertPerformance(); >+} >+ > public void testStartJDTPlugin() throws JavaModelException { > // store current settings > long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval(); >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java,v >retrieving revision 1.44 >diff -u -r1.44 JavaProjectElementInfo.java >--- model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java 13 Apr 2007 16:02:15 -0000 1.44 >+++ model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java 18 Apr 2007 11:55:12 -0000 >@@ -206,13 +206,23 @@ > roots = new IPackageFragmentRoot[0]; > reverseMap.clear(); > } >+ >+ DeltaProcessingState deltaState = JavaModelManager.getJavaModelManager().deltaState; >+ HashMap otherRoots = deltaState.oldOtherRoots; >+ if (otherRoots == null) { >+ deltaState.initializeRoots(); >+ otherRoots = deltaState.otherRoots; >+ } >+ > HashtableOfArrayToObject fragmentsCache = new HashtableOfArrayToObject(); > HashtableOfArrayToObject isPackageCache = new HashtableOfArrayToObject(); > for (int i = 0, length = roots.length; i < length; i++) { > IPackageFragmentRoot root = roots[i]; > IJavaElement[] frags = null; > try { >- if (root.isArchive() && !root.isOpen()) { >+ if (root.isArchive() >+ && !root.isOpen() >+ && otherRoots.get(((JarPackageFragmentRoot) root).jarPath) == null/*only if jar belongs to 1 project (https://bugs.eclipse.org/bugs/show_bug.cgi?id=161175)*/) { > JarPackageFragmentRootInfo info = new JarPackageFragmentRootInfo(); > ((JarPackageFragmentRoot) root).computeChildren(info, new HashMap()); > frags = info.children;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 161175
:
52263
|
64166
|
64214