From c54eb480894ee3376a0df5185655c6a516704001 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 4 May 2010 15:11:35 +0000 Subject: Bug 311546 [perfs] Regression for StatePerformanceTest#testResolution100() --- .../osgi/tests/perf/StatePerformanceTest.java | 9 +++++--- .../osgi/tests/perf/StateUsesPerformanceTest.java | 24 ++++++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StatePerformanceTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StatePerformanceTest.java index fb34770c4..f592456a3 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StatePerformanceTest.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StatePerformanceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,6 +19,9 @@ import org.eclipse.osgi.service.resolver.State; public class StatePerformanceTest extends BasePerformanceTest { + // TODO this should be removed in 3.7 + public final static String PERFORMANCE_BUG311546_EXPLANATION = "Performance decrease caused improvements in memory usage. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=269185 for details."; //$NON-NLS-1$ + public static Test suite() { return new TestSuite(StatePerformanceTest.class); } @@ -55,7 +58,7 @@ public class StatePerformanceTest extends BasePerformanceTest { } public void testResolution100() throws IOException { - testResolution(100, 500, null, null); + testResolution(100, 500, null, PERFORMANCE_BUG311546_EXPLANATION); } public void testResolution1000() throws IOException { @@ -63,7 +66,7 @@ public class StatePerformanceTest extends BasePerformanceTest { } public void testResolution500() throws IOException { - testResolution(500, 50, null, null); + testResolution(500, 50, null, PERFORMANCE_BUG311546_EXPLANATION); } public void testResolution5000() throws IOException { diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StateUsesPerformanceTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StateUsesPerformanceTest.java index 89d233258..6a985eedd 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StateUsesPerformanceTest.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/perf/StateUsesPerformanceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. + * Copyright (c) 2003, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,29 +28,35 @@ public class StateUsesPerformanceTest extends BasePerformanceTest { super(name); } - private void doUsesResolution(int stateSize, int repetitions, String localName) throws BundleException { + private void doUsesResolution(int stateSize, int repetitions, String localName, String degradation) throws BundleException { final State originalState = buildRandomState(stateSize); addUsesBundles(originalState); - new PerformanceTestRunner() { + PerformanceTestRunner runner = new PerformanceTestRunner() { protected void test() { originalState.resolve(false); } - }.run(this, localName, 10, repetitions); + }; + runner.setRegressionReason(degradation); + runner.run(this, localName, 10, repetitions); + } public void testUsesResolution00100() throws BundleException { - doUsesResolution(100, 100, null); + doUsesResolution(100, 100, null, StatePerformanceTest.PERFORMANCE_BUG311546_EXPLANATION); } + public void testUsesResolution00500() throws BundleException { - doUsesResolution(500, 10, null); + doUsesResolution(500, 10, null, StatePerformanceTest.PERFORMANCE_BUG311546_EXPLANATION); } + public void testUsesResolution01000() throws BundleException { - doUsesResolution(1000, 10, null); + doUsesResolution(1000, 10, null, null); } + public void testUsesResolution05000() throws BundleException { - doUsesResolution(5000, 1, null); + doUsesResolution(5000, 1, null, null); } - + private void addUsesBundles(State state) throws BundleException { int id = state.getBundles().length + 500; Hashtable manifest = new Hashtable(); -- cgit v1.2.3