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 62499 Details for
Bug 178499
[perfs] JDT/Core model performances tests must be improved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
New patch on top of v_746
v01.txt (text/plain), 12.48 KB, created by
Frederic Fusier
on 2007-03-30 10:43:42 EDT
(
hide
)
Description:
New patch on top of v_746
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-03-30 10:43:42 EDT
Size:
12.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.performance >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java,v >retrieving revision 1.22 >diff -u -r1.22 FullSourceWorkspaceBuildTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java 27 Apr 2006 14:01:17 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java 30 Mar 2007 14:42:07 -0000 >@@ -425,7 +425,7 @@ > * @throws IOException > */ > public void testFullBuildDefault() throws CoreException, IOException { >- tagAsSummary("Build entire workspace", true); // put in fingerprint >+ tagAsSummary("Build entire workspace", false); // do NOT put in fingerprint > build(null, warningOptions(0/*default warnings*/), false); > } > >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java,v >retrieving revision 1.20 >diff -u -r1.20 FullSourceWorkspaceASTTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java 1 Mar 2007 11:08:15 -0000 1.20 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java 30 Mar 2007 14:42:07 -0000 >@@ -549,16 +549,18 @@ > for (int i = 0; i < 2; i++) { > ASTParser parser = ASTParser.newParser(astLevel); > parser.setSource(unit); >- parser.setResolveBindings(astLevel!=AST.JLS2); >+ parser.setResolveBindings(false); > parser.createAST(null); > } > > // Measures >- for (int i = 0; i < MEASURES_COUNT; i++) { >+ int measures = MEASURES_COUNT * 2; >+ int iterations = ITERATIONS_COUNT >> 1; >+ for (int i = 0; i < measures; i++) { > ASTNode result = null; > runGc(); > startMeasuring(); >- for (int j=0; j<ITERATIONS_COUNT; j++) { >+ for (int j=0; j<iterations; j++) { > ASTParser parser = ASTParser.newParser(astLevel); > parser.setSource(unit); > parser.setResolveBindings(false); >@@ -569,7 +571,7 @@ > CompilationUnit compilationUnit = (CompilationUnit) result; > CommentMapperASTVisitor visitor = new CommentMapperASTVisitor(compilationUnit); > compilationUnit.accept(visitor); >- nodesCount += visitor.nodes * ITERATIONS_COUNT; >+ nodesCount += visitor.nodes * iterations; > } > > // Commit >@@ -711,7 +713,8 @@ > null); > > // Measures >- for (int i = 0; i < MEASURES_COUNT; i++) { >+ int measures = MEASURES_COUNT * 2; >+ for (int i = 0; i < measures; i++) { > runGc(); > startMeasuring(); > parser.createASTs(compilationUnits, new String[0], new ASTRequestor() {/* do nothing*/}, null); >Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java,v >retrieving revision 1.42 >diff -u -r1.42 FullSourceWorkspaceTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java 2 Mar 2007 18:44:11 -0000 1.42 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java 30 Mar 2007 14:42:07 -0000 >@@ -23,11 +23,13 @@ > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.tests.builder.TestingEnvironment; > import org.eclipse.jdt.core.tests.junit.extension.TestCase; >+import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests; > import org.eclipse.jdt.core.tests.performance.util.JdtCorePerformanceMeter; > import org.eclipse.jdt.core.tests.util.Util; > import org.eclipse.jdt.internal.compiler.batch.Main; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; >+import org.eclipse.jdt.internal.core.JavaCorePreferenceInitializer; > import org.eclipse.jdt.internal.core.JavaModelManager; > import org.eclipse.jdt.internal.core.JavaProject; > import org.eclipse.jdt.internal.core.search.indexing.IndexManager; >@@ -794,15 +796,11 @@ > } > }; > IWorkspace workspace = ResourcesPlugin.getWorkspace(); >- if (workspace.isTreeLocked()) { >- compilation.run(null/*no progress available*/); >- } else { >- workspace.run( >- compilation, >- null/*don't take any lock*/, >- IWorkspace.AVOID_UPDATE, >- null/*no progress available here*/); >- } >+ workspace.run( >+ compilation, >+ null/*don't take any lock*/, >+ IWorkspace.AVOID_UPDATE, >+ null/*no progress available here*/); > stopMeasuring(); > } > } >@@ -967,22 +965,9 @@ > for (int i = 0; i < MEASURES_COUNT; i++) { > runGc(); > NullPrintWriter nullPrint= new NullPrintWriter(); >+ Main main = new Main(nullPrint, nullPrint, false); > startMeasuring(); >- final Main main = new Main(nullPrint, nullPrint, false); >- IWorkspaceRunnable compilation = new IWorkspaceRunnable() { >- public void run(IProgressMonitor monitor) throws CoreException { >- main.compile(Main.tokenize(cmdLine)); >- } >- }; >- if (workspace.isTreeLocked()) { >- compilation.run(null/*no progress available*/); >- } else { >- workspace.run( >- compilation, >- null/*don't take any lock*/, >- IWorkspace.AVOID_UPDATE, >- null/*no progress available here*/); >- } >+ main.compile(Main.tokenize(cmdLine)); > stopMeasuring(); > if (!"none".equals(COMPILER_OUTPUT_DIR)) { > Util.delete(COMPILER_OUTPUT_DIR); >@@ -1240,6 +1225,29 @@ > } > return null; > } >+ /* >+ * Simulate a save/exit of the workspace >+ */ >+ protected void simulateExit() throws CoreException { >+ AbstractJavaModelTests.waitForAutoBuild(); >+ ResourcesPlugin.getWorkspace().save(true/*full save*/, null/*no progress*/); >+ JavaModelManager.getJavaModelManager().shutdown(); >+ } >+ /* >+ * Simulate a save/exit/restart of the workspace >+ */ >+ protected void simulateExitRestart() throws CoreException { >+ simulateExit(); >+ simulateRestart(); >+ } >+ /* >+ * Simulate a restart of the workspace >+ */ >+ protected void simulateRestart() throws CoreException { >+ JavaModelManager.doNotUse(); // reset the MANAGER singleton >+ JavaModelManager.getJavaModelManager().startup(); >+ new JavaCorePreferenceInitializer().initializeDefaultPreferences(); >+ } > > /** > * Split a list of compilation units in several arrays. >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.21 >diff -u -r1.21 FullSourceWorkspaceModelTests.java >--- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 14 Mar 2007 16:59:20 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java 30 Mar 2007 14:42:07 -0000 >@@ -39,7 +39,6 @@ > // Tests counters > static int TESTS_COUNT = 0; > private final static int WARMUP_COUNT = 1; // 30; >- private final static int ITERATIONS_COUNT = 1000; > private final static int FOLDERS_COUNT = 200; > private final static int PACKAGES_COUNT = 200; > static int TESTS_LENGTH; >@@ -334,7 +333,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<50000; n++) { > NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY); > nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL); > } >@@ -375,7 +374,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<50000; n++) { > NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY); > nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL); > } >@@ -414,7 +413,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<50000; n++) { > NameLookup nameLookup = BIG_PROJECT.newNameLookup(DefaultWorkingCopyOwner.PRIMARY); > nameLookup.findType(fullQualifiedName, false /*full match*/, NameLookup.ACCEPT_ALL); > } >@@ -453,7 +452,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<50000; n++) { > BIG_PROJECT.findType(fullQualifiedName); > } > stopMeasuring(); >@@ -494,7 +493,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<4000; n++) { > BIG_PROJECT.findType(fullQualifiedName); > } > stopMeasuring(); >@@ -531,7 +530,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<1000; n++) { > BIG_PROJECT.findType(fullQualifiedName); > } > stopMeasuring(); >@@ -569,7 +568,7 @@ > for (int i=0; i<MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int n=0; n<ITERATIONS_COUNT; n++) { >+ for (int n=0; n<2000; n++) { > BIG_PROJECT.findType(fullQualifiedName); > } > stopMeasuring(); >@@ -795,7 +794,7 @@ > for (int i = 0; i < MEASURES_COUNT; i++) { > runGc(); > startMeasuring(); >- for (int j = 0; j < ITERATIONS_COUNT; j++) { >+ for (int j = 0; j < 50000; j++) { > getNameLookup(BIG_PROJECT).seekPackageFragments("org.eclipse.jdt.core.tests" + j + "0.performance" + j, false/*not partial match*/, requestor); > } > stopMeasuring(); >@@ -804,6 +803,93 @@ > assertPerformance(); > } > >+public void testCloseProjects() throws JavaModelException { >+ // store current settings >+ long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval(); >+ boolean oldAutoBuildPolicy = ENV.isAutoBuilding(); >+ >+ // prevent snapshots and autobuilds from disturbing our measures >+ ENV.getWorkspace().getDescription().setSnapshotInterval(100000); >+ ENV.getWorkspace().getDescription().setAutoBuilding(false); >+ >+ try { >+ int length=ALL_PROJECTS.length; >+ // Warm-up >+ for (int i=0; i<WARMUP_COUNT; i++) { >+ for (int j=0; j<length; j++) { >+ ENV.closeProject(ALL_PROJECTS[j].getPath()); >+ } >+ for (int j=0; j<length; j++) { >+ ENV.openProject(ALL_PROJECTS[j].getPath()); >+ } >+ } >+ >+ // Measures >+ for (int i=0; i<MEASURES_COUNT; i++) { >+ AbstractJavaModelTests.waitUntilIndexesReady(); >+ // should not be autobuilding... >+ if (ENV.isAutoBuilding()) { >+ ENV.waitForAutoBuild(); >+ } >+ runGc(); >+ startMeasuring(); >+ for (int j=0; j<length; j++) { >+ ENV.closeProject(ALL_PROJECTS[j].getPath()); >+ } >+ stopMeasuring(); >+ for (int j=0; j<length; j++) { >+ ENV.openProject(ALL_PROJECTS[j].getPath()); >+ } >+ } >+ // Commit >+ commitMeasurements(); >+ assertPerformance(); >+ } >+ finally { >+ // restore previous settings >+ ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval); >+ ENV.getWorkspace().getDescription().setAutoBuilding(oldAutoBuildPolicy); >+ } >+} >+ >+public void testStartJDTPlugin() throws JavaModelException { >+ // store current settings >+ long oldSnapInterval = ENV.getWorkspace().getDescription().getSnapshotInterval(); >+ // prevent snapshots and autobuilds from disturbing our measures >+ ENV.getWorkspace().getDescription().setSnapshotInterval(100000); >+ try { >+ // Warm-up >+ for (int i=0; i<WARMUP_COUNT; i++) { >+ simulateExitRestart(); >+ JavaCore.initializeAfterLoad(null); >+ AbstractJavaModelTests.waitUntilIndexesReady(); >+ } >+ >+ // Measures >+ for (int i=0; i<MEASURES_COUNT; i++) { >+ // shutdwon >+ simulateExit(); >+ runGc(); >+ startMeasuring(); >+ // restart >+ simulateRestart(); >+ JavaCore.initializeAfterLoad(null); >+ AbstractJavaModelTests.waitUntilIndexesReady(); >+ stopMeasuring(); >+ } >+ // Commit >+ commitMeasurements(); >+ assertPerformance(); >+ } >+ catch (CoreException ex) { >+ // do nothing >+ } >+ finally { >+ // restore previous settings >+ ENV.getWorkspace().getDescription().setSnapshotInterval(oldSnapInterval); >+ } >+} >+ > protected void resetCounters() { > // do nothing > }
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 178499
:
62213
|
62243
|
62407
|
62408
|
62477
| 62499