1 // Created on: 2002-04-30
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef QANCollection_PerfLists_HeaderFile
17 #define QANCollection_PerfLists_HeaderFile
19 #include <QANCollection_ListOfPnt.hxx>
20 #include <QANCollection_StackOfPnt.hxx>
21 #include <TColgp_SequenceOfPnt.hxx>
22 #include <TColStd_SetOfInteger.hxx>
24 // ===================== Test perform of List type ==========================
25 void CompList (const Standard_Integer theRep,
26 const Standard_Integer theSize)
30 ////////////////////////////////Perf_Meter aNAppe ("NCollection_List appending",0);
31 ////////////////////////////////Perf_Meter aTAppe ("TCollection_List appending",0);
32 ////////////////////////////////Perf_Meter aNOper ("NCollection_List operator=",0);
33 ////////////////////////////////Perf_Meter aTOper ("TCollection_List operator=",0);
34 ////////////////////////////////Perf_Meter aNClea ("NCollection_List clearing",0);
35 ////////////////////////////////Perf_Meter aTClea ("TCollection_List clearing",0);
36 ////////////////////////////////Perf_Meter aNAssi ("NCollection_List Assign",0);
37 for (i=0; i<theRep; i++)
39 ////////////////////////////////QANCollection_List a1, a2;
40 QANCollection_ListPerf a1, a2;
41 ////////////////////////////////aNAppe.Start();
42 PERF_START_METER("NCollection_List appending")
43 for (j=1; j<=theSize; j++)
49 ////////////////////////////////aNAppe.Stop();
50 PERF_STOP_METER("NCollection_List appending")
51 ////////////////////////////////aNOper.Start();
52 PERF_START_METER("NCollection_List operator=")
54 ////////////////////////////////aNOper.Stop();
55 PERF_STOP_METER("NCollection_List operator=")
56 ////////////////////////////////aNAssi.Start();
57 PERF_START_METER("NCollection_List Assign")
59 ////////////////////////////////aNAssi.Stop();
60 PERF_STOP_METER("NCollection_List Assign")
61 ////////////////////////////////aNClea.Start();
62 PERF_START_METER("NCollection_List clearing")
64 ////////////////////////////////aNClea.Stop();
65 PERF_STOP_METER("NCollection_List clearing")
68 for (i=0; i<theRep; i++)
70 QANCollection_ListOfPnt a1, a2;
71 ////////////////////////////////aTAppe.Start();
72 PERF_START_METER("TCollection_List appending")
73 for (j=1; j<=theSize; j++)
79 ////////////////////////////////aTAppe.Stop();
80 PERF_STOP_METER("TCollection_List appending")
81 ////////////////////////////////aTOper.Start();
82 PERF_START_METER("TCollection_List operator=")
84 ////////////////////////////////aTOper.Stop();
85 PERF_STOP_METER("TCollection_List operator=")
86 ////////////////////////////////aTClea.Start();
87 PERF_START_METER("TCollection_List clearing")
89 ////////////////////////////////aTClea.Stop();
90 PERF_STOP_METER("TCollection_List clearing")
96 // ===================== Test perform of Stack type ==========================
97 void CompStack (const Standard_Integer theRep,
98 const Standard_Integer theSize)
100 Standard_Integer i,j;
102 ////////////////////////////////Perf_Meter aNPush ("NCollection_Stack pushing",0);
103 ////////////////////////////////Perf_Meter aTPush ("TCollection_Stack pushing",0);
104 ////////////////////////////////Perf_Meter aNPopp ("NCollection_Stack popping",0);
105 ////////////////////////////////Perf_Meter aTPopp ("TCollection_Stack popping",0);
106 ////////////////////////////////Perf_Meter aNOper ("NCollection_Stack operator=",0);
107 ////////////////////////////////Perf_Meter aTOper ("TCollection_Stack operator=",0);
108 ////////////////////////////////Perf_Meter aNClea ("NCollection_Stack clearing",0);
109 ////////////////////////////////Perf_Meter aTClea ("TCollection_Stack clearing",0);
110 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Stack Assign",0);
111 for (i=0; i<theRep; i++)
113 ////////////////////////////////QANCollection_Stack a1, a2;
114 QANCollection_StackPerf a1, a2;
115 ////////////////////////////////aNPush.Start();
116 PERF_START_METER("NCollection_Stack pushing")
117 for (j=1; j<=theSize; j++)
123 ////////////////////////////////aNPush.Stop();
124 PERF_STOP_METER("NCollection_Stack pushing")
125 ////////////////////////////////aNOper.Start();
126 PERF_START_METER("NCollection_Stack operator=")
128 ////////////////////////////////aNOper.Stop();
129 PERF_STOP_METER("NCollection_Stack operator=")
130 ////////////////////////////////aNAssi.Start();
131 PERF_START_METER("NCollection_Stack Assign")
133 ////////////////////////////////aNAssi.Stop();
134 PERF_STOP_METER("NCollection_Stack Assign")
135 ////////////////////////////////aNPopp.Start();
136 PERF_START_METER("NCollection_Stack popping")
137 for (j=1; j<=theSize; j++)
139 ////////////////////////////////aNPopp.Stop();
140 PERF_STOP_METER("NCollection_Stack popping")
141 ////////////////////////////////aNClea.Start();
142 PERF_START_METER("NCollection_Stack clearing")
144 ////////////////////////////////aNClea.Stop();
145 PERF_STOP_METER("NCollection_Stack clearing")
148 for (i=0; i<theRep; i++)
150 QANCollection_StackOfPnt a1, a2;
151 ////////////////////////////////aTPush.Start();
152 PERF_START_METER("TCollection_Stack pushing")
153 for (j=1; j<=theSize; j++)
159 ////////////////////////////////aTPush.Stop();
160 PERF_STOP_METER("TCollection_Stack pushing")
161 ////////////////////////////////aTOper.Start();
162 PERF_START_METER("TCollection_Stack operator=")
164 ////////////////////////////////aTOper.Stop();
165 PERF_STOP_METER("TCollection_Stack operator=")
166 ////////////////////////////////aTPopp.Start();
167 PERF_START_METER("TCollection_Stack popping")
168 for (j=1; j<=theSize; j++)
170 ////////////////////////////////aTPopp.Stop();
171 PERF_STOP_METER("TCollection_Stack popping")
172 ////////////////////////////////aTClea.Start();
173 PERF_START_METER("TCollection_Stack clearing")
175 ////////////////////////////////aTClea.Stop();
176 PERF_STOP_METER("TCollection_Stack clearing")
182 // ===================== Test perform of Set type ==========================
183 void CompSet (const Standard_Integer theRep,
184 const Standard_Integer theSize)
186 Standard_Integer i,j;
188 ////////////////////////////////Perf_Meter aNPush ("NCollection_Set pushing",0);
189 ////////////////////////////////Perf_Meter aTPush ("TCollection_Set pushing",0);
190 ////////////////////////////////Perf_Meter aNFind ("NCollection_Set finding",0);
191 ////////////////////////////////Perf_Meter aTFind ("TCollection_Set finding",0);
192 ////////////////////////////////Perf_Meter aNOper ("NCollection_Set operator=",0);
193 ////////////////////////////////Perf_Meter aTOper ("TCollection_Set operator=",0);
194 ////////////////////////////////Perf_Meter aNClea ("NCollection_Set clearing",0);
195 ////////////////////////////////Perf_Meter aTClea ("TCollection_Set clearing",0);
196 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Set Assign",0);
197 for (i=0; i<theRep; i++)
199 ////////////////////////////////QANCollection_Set a1, a2;
200 QANCollection_SetPerf a1, a2;
201 ////////////////////////////////aNPush.Start();
202 PERF_START_METER("NCollection_Set pushing")
203 for (j=1; j<=theSize; j++)
209 ////////////////////////////////aNPush.Stop();
210 PERF_STOP_METER("NCollection_Set pushing")
211 ////////////////////////////////aNFind.Start();
212 PERF_START_METER("NCollection_Set finding")
213 for (j=1; j<=theSize; j++)
219 ////////////////////////////////aNFind.Stop();
220 PERF_STOP_METER("NCollection_Set finding")
221 ////////////////////////////////aNOper.Start();
222 PERF_START_METER("NCollection_Set operator=")
224 ////////////////////////////////aNOper.Stop();
225 PERF_STOP_METER("NCollection_Set operator=")
226 ////////////////////////////////aNAssi.Start();
227 PERF_START_METER("NCollection_Set Assign")
229 ////////////////////////////////aNAssi.Stop();
230 PERF_STOP_METER("NCollection_Set Assign")
231 ////////////////////////////////aNClea.Start();
232 PERF_START_METER("NCollection_Set clearing")
234 ////////////////////////////////aNClea.Stop();
235 PERF_STOP_METER("NCollection_Set clearing")
238 for (i=0; i<theRep; i++)
240 TColStd_SetOfInteger a1, a2;
241 ////////////////////////////////aTPush.Start();
242 PERF_START_METER("TCollection_Set pushing")
243 for (j=1; j<=theSize; j++)
249 ////////////////////////////////aTPush.Stop();
250 PERF_STOP_METER("TCollection_Set pushing")
251 ////////////////////////////////aTFind.Start();
252 PERF_START_METER("TCollection_Set finding")
253 for (j=1; j<=theSize; j++)
259 ////////////////////////////////aTFind.Stop();
260 PERF_STOP_METER("TCollection_Set finding")
261 ////////////////////////////////aTOper.Start();
262 PERF_START_METER("TCollection_Set operator=")
264 ////////////////////////////////aTOper.Stop();
265 PERF_STOP_METER("TCollection_Set operator=")
266 ////////////////////////////////aTClea.Start();
267 PERF_START_METER("TCollection_Set clearing")
269 ////////////////////////////////aTClea.Stop();
270 PERF_STOP_METER("TCollection_Set clearing")
275 // ===================== Test perform of Sequence type ==========================
276 void CompSequence (const Standard_Integer theRep,
277 const Standard_Integer theSize)
279 Standard_Integer i,j;
281 ////////////////////////////////Perf_Meter aNAppe ("NCollection_Sequence appending",0);
282 ////////////////////////////////Perf_Meter aTAppe ("TCollection_Sequence appending",0);
283 ////////////////////////////////Perf_Meter aNFind ("NCollection_Sequence finding",0);
284 ////////////////////////////////Perf_Meter aTFind ("TCollection_Sequence finding",0);
285 ////////////////////////////////Perf_Meter aNOper ("NCollection_Sequence operator=",0);
286 ////////////////////////////////Perf_Meter aTOper ("TCollection_Sequence operator=",0);
287 ////////////////////////////////Perf_Meter aNClea ("NCollection_Sequence clearing",0);
288 ////////////////////////////////Perf_Meter aTClea ("TCollection_Sequence clearing",0);
289 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Sequence Assign",0);
290 for (i=0; i<theRep; i++)
292 ////////////////////////////////QANCollection_Sequence a1, a2;
293 QANCollection_SequencePerf a1, a2;
294 ////////////////////////////////aNAppe.Start();
295 PERF_START_METER("NCollection_Sequence appending")
296 for (j=1; j<=theSize; j++)
302 ////////////////////////////////aNAppe.Stop();
303 PERF_STOP_METER("NCollection_Sequence appending")
304 ////////////////////////////////aNFind.Start();
305 PERF_START_METER("NCollection_Sequence finding")
306 for (j=1; j<=theSize; j++)
308 Standard_Integer iIndex;
309 Random(iIndex,theSize);
312 ////////////////////////////////aNFind.Stop();
313 PERF_STOP_METER("NCollection_Sequence finding")
314 ////////////////////////////////aNOper.Start();
315 PERF_START_METER("NCollection_Sequence operator=")
317 ////////////////////////////////aNOper.Stop();
318 PERF_STOP_METER("NCollection_Sequence operator=")
319 ////////////////////////////////aNAssi.Start();
320 PERF_START_METER("NCollection_Sequence Assign")
322 ////////////////////////////////aNAssi.Stop();
323 PERF_STOP_METER("NCollection_Sequence Assign")
324 ////////////////////////////////aNClea.Start();
325 PERF_START_METER("NCollection_Sequence clearing")
327 ////////////////////////////////aNClea.Stop();
328 PERF_STOP_METER("NCollection_Sequence clearing")
331 for (i=0; i<theRep; i++)
333 TColgp_SequenceOfPnt a1, a2;
334 ////////////////////////////////aTAppe.Start();
335 PERF_START_METER("TCollection_Sequence appending")
336 for (j=1; j<=theSize; j++)
342 ////////////////////////////////aTAppe.Stop();
343 PERF_STOP_METER("TCollection_Sequence appending")
344 ////////////////////////////////aTFind.Start();
345 PERF_START_METER("TCollection_Sequence finding")
346 for (j=1; j<=theSize; j++)
348 Standard_Integer iIndex;
349 Random(iIndex,theSize);
352 ////////////////////////////////aTFind.Stop();
353 PERF_STOP_METER("TCollection_Sequence finding")
354 ////////////////////////////////aTOper.Start();
355 PERF_START_METER("TCollection_Sequence operator=")
357 ////////////////////////////////aTOper.Stop();
358 PERF_STOP_METER("TCollection_Sequence operator=")
359 ////////////////////////////////aTClea.Start();
360 PERF_START_METER("TCollection_Sequence clearing")
362 ////////////////////////////////aTClea.Stop();
363 PERF_STOP_METER("TCollection_Sequence clearing")