View | Details | Raw Unified | Return to bug 331632 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java (-6 / +97 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 89-100 Link Here
89
}
89
}
90
90
91
static {
91
static {
92
//	TESTS_NAMES = new String[] {
92
	TESTS_NAMES = new String[] {
93
//		"testPerfNameLookupFindKnownSecondaryType",
93
//		"testPerfNameLookupFindKnownSecondaryType",
94
//		"testPerfNameLookupFindUnknownType",
94
//		"testPerfNameLookupFindUnknownType",
95
//		"testPerfReconcile",
95
//		"testPerfReconcile",
96
//		"testPerfSearchAllTypeNamesAndReconcile",
96
//		"testPerfSearchAllTypeNamesAndReconcile",
97
//	};
97
		"testOpenProjects",
98
	};
98
99
99
//	TESTS_PREFIX = "testPerfReconcile";
100
//	TESTS_PREFIX = "testPerfReconcile";
100
}
101
}
Lines 129-134 Link Here
129
			IProject bigProject = workspaceRoot.getProject(BIG_PROJECT_NAME);
130
			IProject bigProject = workspaceRoot.getProject(BIG_PROJECT_NAME);
130
			if (bigProject.exists()) {
131
			if (bigProject.exists()) {
131
				ENV.addProject(bigProject);
132
				ENV.addProject(bigProject);
133
				bigProject.open(null);
132
			} else {
134
			} else {
133
				ENV.addProject(BIG_PROJECT_NAME);
135
				ENV.addProject(BIG_PROJECT_NAME);
134
			}
136
			}
Lines 246-255 Link Here
246
248
247
	// Print statistics
249
	// Print statistics
248
	if (TESTS_COUNT == 0) {
250
	if (TESTS_COUNT == 0) {
249
		System.out.println("-------------------------------------");
251
//		System.out.println("-------------------------------------");
250
		System.out.println("Model performance test statistics:");
252
//		System.out.println("Model performance test statistics:");
251
//		NumberFormat intFormat = NumberFormat.getIntegerInstance();
253
//		NumberFormat intFormat = NumberFormat.getIntegerInstance();
252
		System.out.println("-------------------------------------\n");
254
//		System.out.println("-------------------------------------\n");
255
//		ResourcesPlugin.getWorkspace().save(true/*full save*/, null/*no progress*/);
253
	}
256
	}
254
	super.tearDown();
257
	super.tearDown();
255
}
258
}
Lines 1283-1288 Link Here
1283
	}
1286
	}
1284
}
1287
}
1285
1288
1289
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=323514
1290
public void testReopenSingleProject() throws CoreException {
1291
	tagAsSummary("Reopen a single project in a workspace", false); // do NOT put in fingerprint
1292
1293
	// First close all Eclipse projects
1294
	long startTime = 0;
1295
	if (PRINT) {
1296
		System.out.print("Close all Eclipse projects...");
1297
		startTime = System.currentTimeMillis();
1298
	}
1299
	int length=ALL_PROJECTS.length;
1300
	for (int j=0; j<length; j++) {
1301
		ALL_PROJECTS[j].getProject().close(null);
1302
	}		
1303
	AbstractJavaModelTests.waitUntilIndexesReady();
1304
	AbstractJavaModelTests.waitForAutoBuild();
1305
	if (PRINT) {
1306
		System.out.println((System.currentTimeMillis()-startTime)+"ms");
1307
	}
1308
	
1309
1310
	// Warm-up
1311
	if (PRINT) {
1312
		System.out.print("Warmup test...");
1313
		startTime = System.currentTimeMillis();
1314
	}
1315
	final int warmup = WARMUP_COUNT / 10;
1316
	for (int i=0; i<warmup; i++) {
1317
		BIG_PROJECT.getProject().close(null);
1318
		AbstractJavaModelTests.waitUntilIndexesReady();
1319
		AbstractJavaModelTests.waitForAutoBuild();
1320
		BIG_PROJECT.getProject().open(null);
1321
		AbstractJavaModelTests.waitUntilIndexesReady();
1322
		AbstractJavaModelTests.waitForAutoBuild();
1323
		AbstractJavaModelTests.waitForManualRefresh();
1324
	}
1325
	if (PRINT) {
1326
		System.out.println((System.currentTimeMillis()-startTime)+"ms");
1327
	}
1328
1329
	// Measures
1330
	if (PRINT) {
1331
		System.out.println();
1332
		System.out.println("Start measures:");
1333
		startTime = System.currentTimeMillis();
1334
	}
1335
	for (int i=0; i<MEASURES_COUNT; i++) {
1336
		runGc();
1337
		BIG_PROJECT.getProject().close(null);
1338
		AbstractJavaModelTests.waitUntilIndexesReady();
1339
		AbstractJavaModelTests.waitForAutoBuild();
1340
		startMeasuring();
1341
		BIG_PROJECT.getProject().open(null);
1342
		AbstractJavaModelTests.waitUntilIndexesReady();
1343
		AbstractJavaModelTests.waitForAutoBuild();
1344
		AbstractJavaModelTests.waitForManualRefresh();
1345
		stopMeasuring();
1346
	}
1347
	if (PRINT) {
1348
		System.out.println("	total time: "+((System.currentTimeMillis()-startTime)/1000.0)+"s");
1349
	}
1350
1351
	// Commit
1352
	if (PRINT) {
1353
		System.out.println();
1354
		System.out.println("Commit measures:");
1355
		startTime = System.currentTimeMillis();
1356
	}
1357
	commitMeasurements();
1358
	assertPerformance();
1359
1360
	// Finally reopen all Eclipse projects
1361
	if (PRINT) {
1362
		System.out.print("Reopen Eclipse projects...");
1363
		startTime = System.currentTimeMillis();
1364
	}
1365
	for (int i=0; i<length; i++) {
1366
		ALL_PROJECTS[i].getProject().open(null);
1367
	}
1368
	AbstractJavaModelTests.waitUntilIndexesReady();
1369
	AbstractJavaModelTests.waitForAutoBuild();
1370
	AbstractJavaModelTests.waitForManualRefresh();
1371
	runGc();
1372
	if (PRINT) {
1373
		System.out.println((System.currentTimeMillis()-startTime)+"ms");
1374
	}
1375
}
1376
1286
protected void resetCounters() {
1377
protected void resetCounters() {
1287
	// do nothing
1378
	// do nothing
1288
}
1379
}
(-)src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java (+1 lines)
Lines 638-643 Link Here
638
			IProject project = workspaceRoot.getProject(dirName);
638
			IProject project = workspaceRoot.getProject(dirName);
639
			if (project.exists()) {
639
			if (project.exists()) {
640
				ENV.addProject(project);
640
				ENV.addProject(project);
641
				project.open(null);
641
			} else {
642
			} else {
642
				ENV.addProject(dirName);
643
				ENV.addProject(dirName);
643
			}
644
			}

Return to bug 331632