Lines 40-46
Link Here
|
40 |
} |
40 |
} |
41 |
|
41 |
|
42 |
static { |
42 |
static { |
43 |
// TESTS_NAMES = new String[] { "testPerfClassWithPotentialSubinterfaces" }; |
43 |
TESTS_NAMES = new String[] { "testPerSuperTypes" }; |
44 |
} |
44 |
} |
45 |
public static Test suite() { |
45 |
public static Test suite() { |
46 |
Test suite = buildSuite(testClass()); |
46 |
Test suite = buildSuite(testClass()); |
Lines 154-168
Link Here
|
154 |
|
154 |
|
155 |
// Test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=301438 |
155 |
// Test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=301438 |
156 |
public void testPerSuperTypes() throws CoreException { |
156 |
public void testPerSuperTypes() throws CoreException { |
157 |
tagAsSummary("Type hierarchy", true); // put in fingerprint |
157 |
assertNotNull("Parser not found!", PARSER_WORKING_COPY); |
158 |
ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java"); |
|
|
159 |
assertNotNull("Parser not found!", unit); |
160 |
|
158 |
|
161 |
// Warm up |
159 |
// Warm up |
162 |
for (int i=0; i<WARMUP_COUNT; i++) { |
160 |
for (int i=0; i<10*WARMUP_COUNT; i++) { // More Warm up is required. |
163 |
IType[] types = unit.getType("Parser").newSupertypeHierarchy(null).getAllClasses(); |
161 |
IType[] types = PARSER_WORKING_COPY.getType("Parser").newSupertypeHierarchy(null).getAllClasses(); |
164 |
if (i==0) { |
162 |
if (i==0) { |
165 |
System.out.println(" - "+INT_FORMAT.format(types.length)+" all classes found in hierarchy."); |
163 |
System.out.println(" - "+INT_FORMAT.format(types.length)+" classes found in hierarchy."); |
166 |
} |
164 |
} |
167 |
} |
165 |
} |
168 |
|
166 |
|
Lines 173-179
Link Here
|
173 |
for (int i=0; i<MEASURES_COUNT; i++) { |
171 |
for (int i=0; i<MEASURES_COUNT; i++) { |
174 |
runGc(); |
172 |
runGc(); |
175 |
startMeasuring(); |
173 |
startMeasuring(); |
176 |
unit.getType("Parser").newSupertypeHierarchy(null).getAllClasses(); |
174 |
for (int j =0; j < 20; j++) { |
|
|
175 |
PARSER_WORKING_COPY.getType("Parser").newSupertypeHierarchy(null).getAllClasses(); |
176 |
} |
177 |
stopMeasuring(); |
177 |
stopMeasuring(); |
178 |
} |
178 |
} |
179 |
|
179 |
|
Lines 181-185
Link Here
|
181 |
commitMeasurements(); |
181 |
commitMeasurements(); |
182 |
assertPerformance(); |
182 |
assertPerformance(); |
183 |
} |
183 |
} |
184 |
|
|
|
185 |
} |
184 |
} |