Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 345298 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.debug.tests/.cvsignore (-1 lines)
Line 1 Link Here
1
bin
(-)a/org.eclipse.jdt.debug.tests/testprograms/BPManagerPerf.java (+214 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
public class BPManagerPerf {
12
	public static void main(String[] args) {
13
		System.out.println("0");
14
		System.out.println("1");
15
		System.out.println("2");
16
		System.out.println("3");
17
		System.out.println("4");
18
		System.out.println("5");
19
		System.out.println("6");
20
		System.out.println("7");
21
		System.out.println("8");
22
		System.out.println("9");
23
		System.out.println("10");
24
		System.out.println("11");
25
		System.out.println("12");
26
		System.out.println("13");
27
		System.out.println("14");
28
		System.out.println("15");
29
		System.out.println("16");
30
		System.out.println("17");
31
		System.out.println("18");
32
		System.out.println("19");
33
		System.out.println("20");
34
		System.out.println("21");
35
		System.out.println("22");
36
		System.out.println("23");
37
		System.out.println("24");
38
		System.out.println("25");
39
		System.out.println("26");
40
		System.out.println("27");
41
		System.out.println("28");
42
		System.out.println("29");
43
		System.out.println("30");
44
		System.out.println("31");
45
		System.out.println("32");
46
		System.out.println("33");
47
		System.out.println("34");
48
		System.out.println("35");
49
		System.out.println("36");
50
		System.out.println("37");
51
		System.out.println("38");
52
		System.out.println("39");
53
		System.out.println("40");
54
		System.out.println("41");
55
		System.out.println("42");
56
		System.out.println("43");
57
		System.out.println("44");
58
		System.out.println("45");
59
		System.out.println("46");
60
		System.out.println("47");
61
		System.out.println("48");
62
		System.out.println("49");
63
		System.out.println("50");
64
		System.out.println("51");
65
		System.out.println("52");
66
		System.out.println("53");
67
		System.out.println("54");
68
		System.out.println("55");
69
		System.out.println("56");
70
		System.out.println("57");
71
		System.out.println("58");
72
		System.out.println("59");
73
		System.out.println("60");
74
		System.out.println("61");
75
		System.out.println("62");
76
		System.out.println("63");
77
		System.out.println("64");
78
		System.out.println("65");
79
		System.out.println("66");
80
		System.out.println("67");
81
		System.out.println("68");
82
		System.out.println("69");
83
		System.out.println("70");
84
		System.out.println("71");
85
		System.out.println("72");
86
		System.out.println("73");
87
		System.out.println("74");
88
		System.out.println("75");
89
		System.out.println("76");
90
		System.out.println("77");
91
		System.out.println("78");
92
		System.out.println("79");
93
		System.out.println("80");
94
		System.out.println("81");
95
		System.out.println("82");
96
		System.out.println("83");
97
		System.out.println("84");
98
		System.out.println("85");
99
		System.out.println("86");
100
		System.out.println("87");
101
		System.out.println("88");
102
		System.out.println("89");
103
		System.out.println("90");
104
		System.out.println("91");
105
		System.out.println("92");
106
		System.out.println("93");
107
		System.out.println("94");
108
		System.out.println("95");
109
		System.out.println("96");
110
		System.out.println("97");
111
		System.out.println("98");
112
		System.out.println("99");
113
		System.out.println("0");
114
		System.out.println("1");
115
		System.out.println("2");
116
		System.out.println("3");
117
		System.out.println("4");
118
		System.out.println("5");
119
		System.out.println("6");
120
		System.out.println("7");
121
		System.out.println("8");
122
		System.out.println("9");
123
		System.out.println("10");
124
		System.out.println("11");
125
		System.out.println("12");
126
		System.out.println("13");
127
		System.out.println("14");
128
		System.out.println("15");
129
		System.out.println("16");
130
		System.out.println("17");
131
		System.out.println("18");
132
		System.out.println("19");
133
		System.out.println("20");
134
		System.out.println("21");
135
		System.out.println("22");
136
		System.out.println("23");
137
		System.out.println("24");
138
		System.out.println("25");
139
		System.out.println("26");
140
		System.out.println("27");
141
		System.out.println("28");
142
		System.out.println("29");
143
		System.out.println("30");
144
		System.out.println("31");
145
		System.out.println("32");
146
		System.out.println("33");
147
		System.out.println("34");
148
		System.out.println("35");
149
		System.out.println("36");
150
		System.out.println("37");
151
		System.out.println("38");
152
		System.out.println("39");
153
		System.out.println("40");
154
		System.out.println("41");
155
		System.out.println("42");
156
		System.out.println("43");
157
		System.out.println("44");
158
		System.out.println("45");
159
		System.out.println("46");
160
		System.out.println("47");
161
		System.out.println("48");
162
		System.out.println("49");
163
		System.out.println("50");
164
		System.out.println("51");
165
		System.out.println("52");
166
		System.out.println("53");
167
		System.out.println("54");
168
		System.out.println("55");
169
		System.out.println("56");
170
		System.out.println("57");
171
		System.out.println("58");
172
		System.out.println("59");
173
		System.out.println("60");
174
		System.out.println("61");
175
		System.out.println("62");
176
		System.out.println("63");
177
		System.out.println("64");
178
		System.out.println("65");
179
		System.out.println("66");
180
		System.out.println("67");
181
		System.out.println("68");
182
		System.out.println("69");
183
		System.out.println("70");
184
		System.out.println("71");
185
		System.out.println("72");
186
		System.out.println("73");
187
		System.out.println("74");
188
		System.out.println("75");
189
		System.out.println("76");
190
		System.out.println("77");
191
		System.out.println("78");
192
		System.out.println("79");
193
		System.out.println("80");
194
		System.out.println("81");
195
		System.out.println("82");
196
		System.out.println("83");
197
		System.out.println("84");
198
		System.out.println("85");
199
		System.out.println("86");
200
		System.out.println("87");
201
		System.out.println("88");
202
		System.out.println("89");
203
		System.out.println("90");
204
		System.out.println("91");
205
		System.out.println("92");
206
		System.out.println("93");
207
		System.out.println("94");
208
		System.out.println("95");
209
		System.out.println("96");
210
		System.out.println("97");
211
		System.out.println("98");
212
		System.out.println("99");
213
	}
214
}
(-)a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2000, 2007 IBM Corporation and others.
2
 *  Copyright (c) 2000, 2011 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 13-18 Link Here
13
import junit.framework.Test;
13
import junit.framework.Test;
14
import junit.framework.TestSuite;
14
import junit.framework.TestSuite;
15
15
16
import org.eclipse.jdt.debug.tests.performance.BreakpointManagerPerfTests;
16
import org.eclipse.jdt.debug.tests.performance.PerfBreakpointTests;
17
import org.eclipse.jdt.debug.tests.performance.PerfBreakpointTests;
17
import org.eclipse.jdt.debug.tests.performance.PerfConditionalBreakpointsTests;
18
import org.eclipse.jdt.debug.tests.performance.PerfConditionalBreakpointsTests;
18
import org.eclipse.jdt.debug.tests.performance.PerfConsoleTests;
19
import org.eclipse.jdt.debug.tests.performance.PerfConsoleTests;
Lines 45-49 Link Here
45
        addTest(new TestSuite(PerfSteppingTests.class));
46
        addTest(new TestSuite(PerfSteppingTests.class));
46
        addTest(new TestSuite(PerfConsoleTests.class));
47
        addTest(new TestSuite(PerfConsoleTests.class));
47
        addTest(new TestSuite(PerfVariableDetailTests.class));
48
        addTest(new TestSuite(PerfVariableDetailTests.class));
49
        addTest(new TestSuite(BreakpointManagerPerfTests.class));
48
    }
50
    }
49
}
51
}
(-)a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/BreakpointManagerPerfTests.java (+165 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.debug.tests.performance;
12
13
import java.util.ArrayList;
14
15
import org.eclipse.core.resources.IFile;
16
import org.eclipse.core.resources.IResource;
17
import org.eclipse.debug.core.model.IBreakpoint;
18
import org.eclipse.debug.internal.core.BreakpointManager;
19
import org.eclipse.jdt.core.IType;
20
import org.eclipse.jdt.core.Signature;
21
import org.eclipse.jdt.debug.tests.AbstractDebugPerformanceTest;
22
import org.eclipse.test.performance.Dimension;
23
import org.eclipse.ui.IEditorPart;
24
25
/**
26
 * Tests the performance of various parts of the {@link BreakpointManager}
27
 * 
28
 * @since 3.8
29
 */
30
public class BreakpointManagerPerfTests extends AbstractDebugPerformanceTest {
31
	
32
	/**
33
	 * Constructor
34
	 * @param name
35
	 */
36
	public BreakpointManagerPerfTests() {
37
		super("Breakpoint Manager Performance");
38
	}
39
40
	static IBreakpoint[] NO_BREAKPOINTS = new IBreakpoint[0];
41
	static String fgTypeName = "BPManagerPerf";
42
	
43
	/**
44
	 * Create the given number of breakpoints in the given resource starting from the given line
45
	 *  
46
	 * @param count
47
	 * @throws Exception
48
	 * @return the collection of breakpoints
49
	 */
50
	IBreakpoint[] generateBreakpoints(int count) throws Exception {
51
		IType type = getType(fgTypeName);
52
		assertNotNull("the type "+fgTypeName+" should exist", type);
53
		assertTrue("The type "+fgTypeName+" must be a file", type.getResource().getType() == IResource.FILE);
54
		IEditorPart editor = openEditor((IFile)type.getResource());
55
		assertNotNull("the editor for "+fgTypeName+" should have been created", editor);
56
		ArrayList bps = new ArrayList(count);
57
		IBreakpoint bp = createClassPrepareBreakpoint(type);
58
		if(bp != null) {
59
			bps.add(bp);
60
		}
61
		bp = createMethodBreakpoint(fgTypeName, "main", Signature.createMethodSignature(new String[] {"[Ljava.lang.String;"}, Signature.SIG_VOID), true, true);
62
		if(bp != null) {
63
			bps.add(bp);
64
		}
65
		int end = 9+count;
66
		for(int i = 11; i < end; i++) {
67
			bp = createLineBreakpoint(i, fgTypeName);
68
			if(bp != null) {
69
				bps.add(bp);
70
			}
71
		}
72
		assertEquals("the should have been "+count+" breakpoints created", count, bps.size());
73
		return (IBreakpoint[]) bps.toArray(new IBreakpoint[bps.size()]);
74
	}
75
	
76
	/**
77
	 * Tests the time required to start the {@link BreakpointManager}
78
	 * @throws Exception
79
	 */
80
	public void testStartup200Breakpoints() throws Exception {
81
		tagAsSummary("Start Breakpoint Manager - 200 BPs", Dimension.ELAPSED_PROCESS);
82
		try {
83
			IBreakpoint[] bps = generateBreakpoints(200);
84
			assertTrue("There should be 200 breakpoints", bps.length == 200);
85
			BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
86
			//clean it up before starting
87
			mgr.shutdown();
88
			for(int i = 0; i < 6500; i++) {
89
				try {
90
					startMeasuring();
91
					mgr.start();
92
					stopMeasuring();
93
				}
94
				finally {
95
					mgr.shutdown();
96
				}
97
			}
98
			commitMeasurements();
99
			assertPerformance();
100
		}
101
		finally {
102
			removeAllBreakpoints();
103
		}
104
	}
105
	
106
	/**
107
	 * Tests the time required to start the {@link BreakpointManager}
108
	 * @throws Exception
109
	 */
110
	public void testStartup50Breakpoints() throws Exception {
111
		tagAsSummary("Start Breakpoint Manager - 50 BPs", Dimension.ELAPSED_PROCESS);
112
		try {
113
			IBreakpoint[] bps = generateBreakpoints(50);
114
			assertTrue("There should be 50 breakpoints", bps.length == 50);
115
			BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
116
			//clean it up before starting
117
			mgr.shutdown();
118
			for(int i = 0; i < 6500; i++) {
119
				try {
120
					startMeasuring();
121
					mgr.start();
122
					stopMeasuring();
123
				}
124
				finally {
125
					mgr.shutdown();
126
				}
127
			}
128
			commitMeasurements();
129
			assertPerformance();
130
		}
131
		finally {
132
			removeAllBreakpoints();
133
		}
134
	}
135
	
136
	/**
137
	 * Tests the time required to start the {@link BreakpointManager}
138
	 * @throws Exception
139
	 */
140
	public void testStartup100Breakpoints() throws Exception {
141
		tagAsSummary("Start Breakpoint Manager - 100 BPs", Dimension.ELAPSED_PROCESS);
142
		try {
143
			IBreakpoint[] bps = generateBreakpoints(100);
144
			assertTrue("There should be 100 breakpoints", bps.length == 100);
145
			BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
146
			//clean it up before starting
147
			mgr.shutdown();
148
			for(int i = 0; i < 6500; i++) {
149
				try {
150
					startMeasuring();
151
					mgr.start();
152
					stopMeasuring();
153
				}
154
				finally {
155
					mgr.shutdown();
156
				}
157
			}
158
			commitMeasurements();
159
			assertPerformance();
160
		}
161
		finally {
162
			removeAllBreakpoints();
163
		}
164
	}
165
}

Return to bug 345298