0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / QANCollection / QANCollection_Perf.cxx
CommitLineData
3a01a933 1// Created on: 2004-03-05
2// Created by: Mikhail KUZMITCHEV
3// Copyright (c) 2004-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#include <QANCollection.hxx>
17#include <QANCollection_Common.hxx>
18
19#include <Draw.hxx>
20#include <Draw_Interpretor.hxx>
21
22#include <TColgp_Array1OfPnt.hxx>
23#include <TColgp_Array2OfPnt.hxx>
24#include <TColStd_MapOfReal.hxx>
25#include <TColStd_IndexedMapOfReal.hxx>
26#include <TColgp_SequenceOfPnt.hxx>
27
28#include <QANCollection_DataMapOfRealPnt.hxx>
29#include <QANCollection_DoubleMapOfRealInteger.hxx>
30#include <QANCollection_IndexedDataMapOfRealPnt.hxx>
31#include <QANCollection_ListOfPnt.hxx>
32
33#include <NCollection_SparseArray.hxx>
34#include <NCollection_SparseArrayBase.hxx>
35
36#define PERF_ENABLE_METERS
37#include <OSD_PerfMeter.hxx>
38
39#define ItemType gp_Pnt
40#define Key1Type Standard_Real
41#define Key2Type Standard_Integer
42
43// ===================== INSTANTIATIONS ===========
44// ===================== The Types must be defined before this line ===========
45// These are: TheItemType, TheKey1Type, TheKey2Type
46// So must be defined ::HashCode and ::IsEqual too
47
48#include <NCollection_DefineArray1.hxx>
49#include <NCollection_DefineHArray1.hxx>
50////////////////////////////////DEFINE_ARRAY1(QANCollection_Array1,QANCollection_BaseCol,ItemType)
51////////////////////////////////DEFINE_HARRAY1(QANCollection_HArray1,QANCollection_Array1)
52DEFINE_ARRAY1(QANCollection_Array1Perf,QANCollection_BaseColPerf,ItemType)
53DEFINE_HARRAY1(QANCollection_HArray1Perf,QANCollection_Array1Perf)
54IMPLEMENT_HARRAY1(QANCollection_HArray1Perf)
55
56#include <NCollection_DefineArray2.hxx>
57#include <NCollection_DefineHArray2.hxx>
58////////////////////////////////DEFINE_ARRAY2(QANCollection_Array2,QANCollection_BaseCol,ItemType)
59////////////////////////////////DEFINE_HARRAY2(QANCollection_HArray2,QANCollection_Array2)
60DEFINE_ARRAY2(QANCollection_Array2Perf,QANCollection_BaseColPerf,ItemType)
61DEFINE_HARRAY2(QANCollection_HArray2Perf,QANCollection_Array2Perf)
62IMPLEMENT_HARRAY2(QANCollection_HArray2Perf)
63
64#include <NCollection_DefineMap.hxx>
65#include <NCollection_DefineDataMap.hxx>
66#include <NCollection_DefineDoubleMap.hxx>
67#include <NCollection_DefineIndexedMap.hxx>
68#include <NCollection_DefineIndexedDataMap.hxx>
69////////////////////////////////DEFINE_MAP(QANCollection_Map,QANCollection_Key1BaseCol,Key1Type)
70////////////////////////////////DEFINE_DATAMAP(QANCollection_DataMap,QANCollection_BaseCol,Key1Type,ItemType)
71////////////////////////////////DEFINE_DOUBLEMAP(QANCollection_DoubleMap,QANCollection_Key2BaseCol,Key1Type,Key2Type)
72////////////////////////////////DEFINE_INDEXEDMAP(QANCollection_IndexedMap,QANCollection_Key1BaseCol,Key1Type)
73////////////////////////////////DEFINE_INDEXEDDATAMAP(QANCollection_IDMap,QANCollection_BaseCol,Key1Type,ItemType)
74DEFINE_MAP(QANCollection_MapPerf,QANCollection_Key1BaseColPerf,Key1Type)
75DEFINE_DATAMAP(QANCollection_DataMapPerf,QANCollection_BaseColPerf,Key1Type,ItemType)
76DEFINE_DOUBLEMAP(QANCollection_DoubleMapPerf,QANCollection_Key2BaseColPerf,Key1Type,Key2Type)
77DEFINE_INDEXEDMAP(QANCollection_IndexedMapPerf,QANCollection_Key1BaseColPerf,Key1Type)
78DEFINE_INDEXEDDATAMAP(QANCollection_IDMapPerf,QANCollection_BaseColPerf,Key1Type,ItemType)
79
80#include <NCollection_DefineList.hxx>
81////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType)
82DEFINE_LIST(QANCollection_ListPerf,QANCollection_BaseColPerf,ItemType)
83
84#include <NCollection_DefineSequence.hxx>
85#include <NCollection_DefineHSequence.hxx>
86////////////////////////////////DEFINE_SEQUENCE(QANCollection_Sequence,QANCollection_BaseCol,ItemType)
87////////////////////////////////DEFINE_HSEQUENCE(QANCollection_HSequence,QANCollection_Sequence)
88DEFINE_SEQUENCE(QANCollection_SequencePerf,QANCollection_BaseColPerf,ItemType)
89DEFINE_HSEQUENCE(QANCollection_HSequencePerf,QANCollection_SequencePerf)
90IMPLEMENT_HSEQUENCE(QANCollection_HSequencePerf)
91
92// ===================== Test perform of Array1 type ==========================
93static void CompArray1 (const Standard_Integer theRep,
94 const Standard_Integer theSize)
95{
96 Standard_Integer i,j;
97
98 ////////////////////////////////Perf_Meter aNCrea ("NCollection_Array1 creation",0);
99 ////////////////////////////////Perf_Meter aTCrea ("TCollection_Array1 creation",0);
100 ////////////////////////////////Perf_Meter aNFill ("NCollection_Array1 filling",0);
101 ////////////////////////////////Perf_Meter aTFill ("TCollection_Array1 filling",0);
102 ////////////////////////////////Perf_Meter aNFind ("NCollection_Array1 finding",0);
103 ////////////////////////////////Perf_Meter aTFind ("TCollection_Array1 finding",0);
104 ////////////////////////////////Perf_Meter aNOper ("NCollection_Array1 operator=",0);
105 ////////////////////////////////Perf_Meter aTOper ("TCollection_Array1 operator=",0);
106 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Array1 Assign",0);
107 for (i=0; i<theRep; i++)
108 {
109 ////////////////////////////////aNCrea.Start();
110 PERF_START_METER("NCollection_Array1 creation")
111 ////////////////////////////////QANCollection_Array1 a1(1,theSize), a2(1,theSize);
112 QANCollection_Array1Perf a1(1,theSize), a2(1,theSize);
113 ////////////////////////////////aNCrea.Stop();
114 PERF_STOP_METER("NCollection_Array1 creation")
115 ////////////////////////////////aNFill.Start();
116 PERF_START_METER("NCollection_Array1 filling")
117 for (j=1; j<=theSize; j++)
118 Random(a1(j));
119 ////////////////////////////////aNFill.Stop();
120 PERF_STOP_METER("NCollection_Array1 filling")
121 ////////////////////////////////aNFind.Start();
122 PERF_START_METER("NCollection_Array1 finding")
123 for (j=1; j<=theSize; j++)
124 {
125 Standard_Integer iIndex;
126 Random(iIndex,theSize);
127 a1.Value(iIndex+1);
128 }
129 ////////////////////////////////aNFind.Stop();
130 PERF_STOP_METER("NCollection_Array1 finding")
131 ////////////////////////////////aNOper.Start();
132 PERF_START_METER("NCollection_Array1 operator=")
133 a2 = a1;
134 ////////////////////////////////aNOper.Stop();
135 PERF_STOP_METER("NCollection_Array1 operator=")
136 ////////////////////////////////aNAssi.Start();
137 PERF_START_METER("NCollection_Array1 Assign")
138 a2.Assign(a1);
139 ////////////////////////////////aNAssi.Stop();
140 PERF_STOP_METER("NCollection_Array1 Assign")
141 }
142
143 for (i=0; i<theRep; i++)
144 {
145 ////////////////////////////////aTCrea.Start();
146 PERF_START_METER("TCollection_Array1 creation")
147 TColgp_Array1OfPnt a1(1,theSize), a2(1,theSize);
148 ////////////////////////////////aTCrea.Stop();
149 PERF_STOP_METER("TCollection_Array1 creation")
150 ////////////////////////////////aTFill.Start();
151 PERF_START_METER("TCollection_Array1 filling")
152 for (j=1; j<=theSize; j++)
153 Random(a1(j));
154 ////////////////////////////////aTFill.Stop();
155 PERF_STOP_METER("TCollection_Array1 filling")
156 ////////////////////////////////aTFind.Start();
157 PERF_START_METER("TCollection_Array1 finding")
158 for (j=1; j<=theSize; j++)
159 {
160 Standard_Integer iIndex;
161 Random(iIndex,theSize);
162 a1.Value(iIndex+1);
163 }
164 ////////////////////////////////aTFind.Stop();
165 PERF_STOP_METER("TCollection_Array1 finding")
166 ////////////////////////////////aTOper.Start();
167 PERF_START_METER("TCollection_Array1 operator=")
168 a2 = a1;
169 ////////////////////////////////aTOper.Stop();
170 PERF_STOP_METER("TCollection_Array1 operator=")
171 }
172 PERF_PRINT_ALL
173}
174
175// ===================== Test perform of Array2 type ==========================
176static void CompArray2 (const Standard_Integer theRep,
177 const Standard_Integer theSize)
178{
179 Standard_Integer i,j,k;
180
181 ////////////////////////////////Perf_Meter aNCrea ("NCollection_Array2 creation",0);
182 ////////////////////////////////Perf_Meter aTCrea ("TCollection_Array2 creation",0);
183 ////////////////////////////////Perf_Meter aNFill ("NCollection_Array2 filling",0);
184 ////////////////////////////////Perf_Meter aTFill ("TCollection_Array2 filling",0);
185 ////////////////////////////////Perf_Meter aNFind ("NCollection_Array2 finding",0);
186 ////////////////////////////////Perf_Meter aTFind ("TCollection_Array2 finding",0);
187 ////////////////////////////////Perf_Meter aNOper ("NCollection_Array2 operator=",0);
188 ////////////////////////////////Perf_Meter aTOper ("TCollection_Array2 operator=",0);
189 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Array2 Assign",0);
190 for (i=0; i<theRep; i++)
191 {
192 ////////////////////////////////aNCrea.Start();
193 PERF_START_METER("NCollection_Array2 creation")
194 ////////////////////////////////QANCollection_Array2 a1(1,theSize,1,theSize), a2(1,theSize,1,theSize);
195 QANCollection_Array2Perf a1(1,theSize,1,theSize), a2(1,theSize,1,theSize);
196 ////////////////////////////////aNCrea.Stop();
197 PERF_STOP_METER("NCollection_Array2 creation")
198 ////////////////////////////////aNFill.Start();
199 PERF_START_METER("NCollection_Array2 filling")
200 for (j=1; j<=theSize; j++)
201 for (k=1; k<=theSize; k++)
202 Random(a1(j,k));
203 ////////////////////////////////aNFill.Stop();
204 PERF_STOP_METER("NCollection_Array2 filling")
205 ////////////////////////////////aNFind.Start();
206 PERF_START_METER("NCollection_Array2 finding")
207 for (j=1; j<=theSize*theSize; j++)
208 {
209 Standard_Integer m,n;
210 Random(m,theSize);
211 Random(n,theSize);
212 a1.Value(m+1,n+1);
213 }
214 ////////////////////////////////aNFind.Stop();
215 PERF_STOP_METER("NCollection_Array2 finding")
216 ////////////////////////////////aNOper.Start();
217 PERF_START_METER("NCollection_Array2 operator=")
218 a2 = a1;
219 ////////////////////////////////aNOper.Stop();
220 PERF_STOP_METER("NCollection_Array2 operator=")
221 ////////////////////////////////aNAssi.Start();
222 PERF_START_METER("NCollection_Array2 Assign")
223 a2.Assign(a1);
224 ////////////////////////////////aNAssi.Stop();
225 PERF_STOP_METER("NCollection_Array2 Assign")
226 }
227
228 for (i=0; i<theRep; i++)
229 {
230 ////////////////////////////////aTCrea.Start();
231 PERF_START_METER("TCollection_Array2 creation")
232 TColgp_Array2OfPnt a1(1,theSize,1,theSize), a2(1,theSize,1,theSize);
233 ////////////////////////////////aTCrea.Stop();
234 PERF_STOP_METER("TCollection_Array2 creation")
235 ////////////////////////////////aTFill.Start();
236 PERF_START_METER("TCollection_Array2 filling")
237 for (j=1; j<=theSize; j++)
238 for (k=1; k<=theSize; k++)
239 Random(a1(j,k));
240 ////////////////////////////////aTFill.Stop();
241 PERF_STOP_METER("TCollection_Array2 filling")
242 ////////////////////////////////aTFind.Start();
243 PERF_START_METER("TCollection_Array2 finding")
244 for (j=1; j<=theSize*theSize; j++)
245 {
246 Standard_Integer m,n;
247 Random(m,theSize);
248 Random(n,theSize);
249 a1.Value(m+1,n+1);
250 }
251 ////////////////////////////////aTFind.Stop();
252 PERF_STOP_METER("TCollection_Array2 finding")
253 ////////////////////////////////aTOper.Start();
254 PERF_START_METER("TCollection_Array2 operator=")
255 a2 = a1;
256 ////////////////////////////////aTOper.Stop();
257 PERF_STOP_METER("TCollection_Array2 operator=")
258 }
259 PERF_PRINT_ALL
260}
261
262// ===================== Test perform of List type ==========================
263static void CompList (const Standard_Integer theRep,
264 const Standard_Integer theSize)
265{
266 Standard_Integer i,j;
267
268 ////////////////////////////////Perf_Meter aNAppe ("NCollection_List appending",0);
269 ////////////////////////////////Perf_Meter aTAppe ("TCollection_List appending",0);
270 ////////////////////////////////Perf_Meter aNOper ("NCollection_List operator=",0);
271 ////////////////////////////////Perf_Meter aTOper ("TCollection_List operator=",0);
272 ////////////////////////////////Perf_Meter aNClea ("NCollection_List clearing",0);
273 ////////////////////////////////Perf_Meter aTClea ("TCollection_List clearing",0);
274 ////////////////////////////////Perf_Meter aNAssi ("NCollection_List Assign",0);
275 for (i=0; i<theRep; i++)
276 {
277 ////////////////////////////////QANCollection_List a1, a2;
278 QANCollection_ListPerf a1, a2;
279 ////////////////////////////////aNAppe.Start();
280 PERF_START_METER("NCollection_List appending")
281 for (j=1; j<=theSize; j++)
282 {
283 ItemType anItem;
284 Random(anItem);
285 a1.Append(anItem);
286 }
287 ////////////////////////////////aNAppe.Stop();
288 PERF_STOP_METER("NCollection_List appending")
289 ////////////////////////////////aNOper.Start();
290 PERF_START_METER("NCollection_List operator=")
291 a2 = a1;
292 ////////////////////////////////aNOper.Stop();
293 PERF_STOP_METER("NCollection_List operator=")
294 ////////////////////////////////aNAssi.Start();
295 PERF_START_METER("NCollection_List Assign")
296 a2.Assign(a1);
297 ////////////////////////////////aNAssi.Stop();
298 PERF_STOP_METER("NCollection_List Assign")
299 ////////////////////////////////aNClea.Start();
300 PERF_START_METER("NCollection_List clearing")
301 a2.Clear();
302 ////////////////////////////////aNClea.Stop();
303 PERF_STOP_METER("NCollection_List clearing")
304 }
305
306 for (i=0; i<theRep; i++)
307 {
308 QANCollection_ListOfPnt a1, a2;
309 ////////////////////////////////aTAppe.Start();
310 PERF_START_METER("TCollection_List appending")
311 for (j=1; j<=theSize; j++)
312 {
313 ItemType anItem;
314 Random(anItem);
315 a1.Append(anItem);
316 }
317 ////////////////////////////////aTAppe.Stop();
318 PERF_STOP_METER("TCollection_List appending")
319 ////////////////////////////////aTOper.Start();
320 PERF_START_METER("TCollection_List operator=")
321 a2 = a1;
322 ////////////////////////////////aTOper.Stop();
323 PERF_STOP_METER("TCollection_List operator=")
324 ////////////////////////////////aTClea.Start();
325 PERF_START_METER("TCollection_List clearing")
326 a2.Clear();
327 ////////////////////////////////aTClea.Stop();
328 PERF_STOP_METER("TCollection_List clearing")
329 }
330 PERF_PRINT_ALL
331}
332
333// ===================== Test perform of Sequence type ==========================
334static void CompSequence (const Standard_Integer theRep,
335 const Standard_Integer theSize)
336{
337 Standard_Integer i,j;
338
339 ////////////////////////////////Perf_Meter aNAppe ("NCollection_Sequence appending",0);
340 ////////////////////////////////Perf_Meter aTAppe ("TCollection_Sequence appending",0);
341 ////////////////////////////////Perf_Meter aNFind ("NCollection_Sequence finding",0);
342 ////////////////////////////////Perf_Meter aTFind ("TCollection_Sequence finding",0);
343 ////////////////////////////////Perf_Meter aNOper ("NCollection_Sequence operator=",0);
344 ////////////////////////////////Perf_Meter aTOper ("TCollection_Sequence operator=",0);
345 ////////////////////////////////Perf_Meter aNClea ("NCollection_Sequence clearing",0);
346 ////////////////////////////////Perf_Meter aTClea ("TCollection_Sequence clearing",0);
347 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Sequence Assign",0);
348 for (i=0; i<theRep; i++)
349 {
350 ////////////////////////////////QANCollection_Sequence a1, a2;
351 QANCollection_SequencePerf a1, a2;
352 ////////////////////////////////aNAppe.Start();
353 PERF_START_METER("NCollection_Sequence appending")
354 for (j=1; j<=theSize; j++)
355 {
356 ItemType anItem;
357 Random(anItem);
358 a1.Append(anItem);
359 }
360 ////////////////////////////////aNAppe.Stop();
361 PERF_STOP_METER("NCollection_Sequence appending")
362 ////////////////////////////////aNFind.Start();
363 PERF_START_METER("NCollection_Sequence finding")
364 for (j=1; j<=theSize; j++)
365 {
366 Standard_Integer iIndex;
367 Random(iIndex,theSize);
368 a1.Value(iIndex+1);
369 }
370 ////////////////////////////////aNFind.Stop();
371 PERF_STOP_METER("NCollection_Sequence finding")
372 ////////////////////////////////aNOper.Start();
373 PERF_START_METER("NCollection_Sequence operator=")
374 a2 = a1;
375 ////////////////////////////////aNOper.Stop();
376 PERF_STOP_METER("NCollection_Sequence operator=")
377 ////////////////////////////////aNAssi.Start();
378 PERF_START_METER("NCollection_Sequence Assign")
379 a2.Assign(a1);
380 ////////////////////////////////aNAssi.Stop();
381 PERF_STOP_METER("NCollection_Sequence Assign")
382 ////////////////////////////////aNClea.Start();
383 PERF_START_METER("NCollection_Sequence clearing")
384 a2.Clear();
385 ////////////////////////////////aNClea.Stop();
386 PERF_STOP_METER("NCollection_Sequence clearing")
387 }
388
389 for (i=0; i<theRep; i++)
390 {
391 TColgp_SequenceOfPnt a1, a2;
392 ////////////////////////////////aTAppe.Start();
393 PERF_START_METER("TCollection_Sequence appending")
394 for (j=1; j<=theSize; j++)
395 {
396 ItemType anItem;
397 Random(anItem);
398 a1.Append(anItem);
399 }
400 ////////////////////////////////aTAppe.Stop();
401 PERF_STOP_METER("TCollection_Sequence appending")
402 ////////////////////////////////aTFind.Start();
403 PERF_START_METER("TCollection_Sequence finding")
404 for (j=1; j<=theSize; j++)
405 {
406 Standard_Integer iIndex;
407 Random(iIndex,theSize);
408 a1.Value(iIndex+1);
409 }
410 ////////////////////////////////aTFind.Stop();
411 PERF_STOP_METER("TCollection_Sequence finding")
412 ////////////////////////////////aTOper.Start();
413 PERF_START_METER("TCollection_Sequence operator=")
414 a2 = a1;
415 ////////////////////////////////aTOper.Stop();
416 PERF_STOP_METER("TCollection_Sequence operator=")
417 ////////////////////////////////aTClea.Start();
418 PERF_START_METER("TCollection_Sequence clearing")
419 a2.Clear();
420 ////////////////////////////////aTClea.Stop();
421 PERF_STOP_METER("TCollection_Sequence clearing")
422 }
423 PERF_PRINT_ALL
424}
425
426// ===================== Test perform of Map type ==========================
427static void CompMap (const Standard_Integer theRep,
428 const Standard_Integer theSize)
429{
430 Standard_Integer i,j;
431
432 ////////////////////////////////Perf_Meter aNBind ("NCollection_Map adding",0);
433 ////////////////////////////////Perf_Meter aTBind ("TCollection_Map adding",0);
434 ////////////////////////////////Perf_Meter aNOper ("NCollection_Map operator=",0);
435 ////////////////////////////////Perf_Meter aTOper ("TCollection_Map operator=",0);
436 ////////////////////////////////Perf_Meter aNFind ("NCollection_Map finding",0);
437 ////////////////////////////////Perf_Meter aTFind ("TCollection_Map finding",0);
438 ////////////////////////////////Perf_Meter aNClea ("NCollection_Map clearing",0);
439 ////////////////////////////////Perf_Meter aTClea ("TCollection_Map clearing",0);
440 ////////////////////////////////Perf_Meter aNAssi ("NCollection_Map Assign",0);
441 for (i=0; i<theRep; i++)
442 {
443 ////////////////////////////////QANCollection_Map a1, a2;
444 QANCollection_MapPerf a1, a2;
445 ////////////////////////////////aNBind.Start();
446 PERF_START_METER("NCollection_Map adding")
447 for (j=1; j<=theSize; j++)
448 {
449 Key1Type aKey1;
450 Random(aKey1);
451 a1.Add(aKey1);
452 }
453 ////////////////////////////////aNBind.Stop();
454 PERF_STOP_METER("NCollection_Map adding")
455 ////////////////////////////////aNFind.Start();
456 PERF_START_METER("NCollection_Map finding")
457 for (j=1; j<=theSize; j++)
458 {
459 Key1Type aKey1;
460 Random(aKey1);
461 a1.Contains(aKey1);
462 }
463 ////////////////////////////////aNFind.Stop();
464 PERF_STOP_METER("NCollection_Map finding")
465 ////////////////////////////////aNOper.Start();
466 PERF_START_METER("NCollection_Map operator=")
467 a2 = a1;
468 ////////////////////////////////aNOper.Stop();
469 PERF_STOP_METER("NCollection_Map operator=")
470 ////////////////////////////////aNAssi.Start();
471 PERF_START_METER("NCollection_Map Assign")
472 a2.Assign(a1);
473 ////////////////////////////////aNAssi.Stop();
474 PERF_STOP_METER("NCollection_Map Assign")
475 ////////////////////////////////aNClea.Start();
476 PERF_START_METER("NCollection_Map clearing")
477 a2.Clear();
478 ////////////////////////////////aNClea.Stop();
479 PERF_STOP_METER("NCollection_Map clearing")
480 }
481
482 for (i=0; i<theRep; i++)
483 {
484 TColStd_MapOfReal a1, a2;
485 ////////////////////////////////aTBind.Start();
486 PERF_START_METER("TCollection_Map adding")
487 for (j=1; j<=theSize; j++)
488 {
489 Key1Type aKey1;
490 Random(aKey1);
491 a1.Add(aKey1);
492 }
493 ////////////////////////////////aTBind.Stop();
494 PERF_STOP_METER("TCollection_Map adding")
495 ////////////////////////////////aTFind.Start();
496 PERF_START_METER("TCollection_Map finding")
497 for (j=1; j<=theSize; j++)
498 {
499 Key1Type aKey1;
500 Random(aKey1);
501 a1.Contains(aKey1);
502 }
503 ////////////////////////////////aTFind.Stop();
504 PERF_STOP_METER("TCollection_Map finding")
505 ////////////////////////////////aTOper.Start();
506 PERF_START_METER("TCollection_Map operator=")
507 a2 = a1;
508 ////////////////////////////////aTOper.Stop();
509 PERF_STOP_METER("TCollection_Map operator=")
510 ////////////////////////////////aTClea.Start();
511 PERF_START_METER("TCollection_Map clearing")
512 a2.Clear();
513 ////////////////////////////////aTClea.Stop();
514 PERF_STOP_METER("TCollection_Map clearing")
515 }
516 PERF_PRINT_ALL
517}
518
519// ===================== Test perform of DataMap type ==========================
520static void CompDataMap (const Standard_Integer theRep,
521 const Standard_Integer theSize)
522{
523 Standard_Integer i,j;
524
525 ////////////////////////////////Perf_Meter aNBind ("NCollection_DataMap binding",0);
526 ////////////////////////////////Perf_Meter aTBind ("TCollection_DataMap binding",0);
527 ////////////////////////////////Perf_Meter aNFind ("NCollection_DataMap finding",0);
528 ////////////////////////////////Perf_Meter aTFind ("TCollection_DataMap finding",0);
529 ////////////////////////////////Perf_Meter aNOper ("NCollection_DataMap operator=",0);
530 ////////////////////////////////Perf_Meter aTOper ("TCollection_DataMap operator=",0);
531 ////////////////////////////////Perf_Meter aNClea ("NCollection_DataMap clearing",0);
532 ////////////////////////////////Perf_Meter aTClea ("TCollection_DataMap clearing",0);
533 //////////////////////////////////Perf_Meter aNAssi ("NCollection_DataMap Assign",0);
534 for (i=0; i<theRep; i++)
535 {
536 ////////////////////////////////QANCollection_DataMap a1, a2;
537 QANCollection_DataMapPerf a1, a2;
538 ////////////////////////////////aNBind.Start();
539 PERF_START_METER("NCollection_DataMap binding")
540 for (j=1; j<=theSize; j++)
541 {
542 Key1Type aKey1;
543 ItemType anItem;
544 Random(aKey1);
545 Random(anItem);
546 a1.Bind(aKey1,anItem);
547 }
548 ////////////////////////////////aNBind.Stop();
549 PERF_STOP_METER("NCollection_DataMap binding")
550 ////////////////////////////////aNFind.Start();
551 PERF_START_METER("NCollection_DataMap finding")
552 for (j=1; j<=theSize; j++)
553 {
554 Key1Type aKey1;
555 Random(aKey1);
556 a1.IsBound(aKey1);
557 }
558 ////////////////////////////////aNFind.Stop();
559 PERF_STOP_METER("NCollection_DataMap finding")
560 ////////////////////////////////aNOper.Start();
561 PERF_START_METER("NCollection_DataMap operator=")
562 a2 = a1;
563 ////////////////////////////////aNOper.Stop();
564 PERF_STOP_METER("NCollection_DataMap operator=")
565 //aNAssi.Start();
566 //a2.Assign(a1);
567 //aNAssi.Stop();
568 ////////////////////////////////aNClea.Start();
569 PERF_START_METER("NCollection_DataMap clearing")
570 a2.Clear();
571 ////////////////////////////////aNClea.Stop();
572 PERF_STOP_METER("NCollection_DataMap clearing")
573 }
574
575 for (i=0; i<theRep; i++)
576 {
577 QANCollection_DataMapOfRealPnt a1, a2;
578 ////////////////////////////////aTBind.Start();
579 PERF_START_METER("TCollection_DataMap binding")
580 for (j=1; j<=theSize; j++)
581 {
582 Key1Type aKey1;
583 ItemType anItem;
584 Random(aKey1);
585 Random(anItem);
586 a1.Bind(aKey1,anItem);
587 }
588 ////////////////////////////////aTBind.Stop();
589 PERF_STOP_METER("TCollection_DataMap binding")
590 ////////////////////////////////aTFind.Start();
591 PERF_START_METER("TCollection_DataMap finding")
592 for (j=1; j<=theSize; j++)
593 {
594 Key1Type aKey1;
595 Random(aKey1);
596 a1.IsBound(aKey1);
597 }
598 ////////////////////////////////aTFind.Stop();
599 PERF_STOP_METER("TCollection_DataMap finding")
600 ////////////////////////////////aTOper.Start();
601 PERF_START_METER("TCollection_DataMap operator=")
602 a2 = a1;
603 ////////////////////////////////aTOper.Stop();
604 PERF_STOP_METER("TCollection_DataMap operator=")
605 ////////////////////////////////aTClea.Start();
606 PERF_START_METER("TCollection_DataMap clearing")
607 a2.Clear();
608 ////////////////////////////////aTClea.Stop();
609 PERF_STOP_METER("TCollection_DataMap clearing")
610 }
611 PERF_PRINT_ALL
612}
613
614// ===================== Test perform of DoubleMap type ==========================
615static void CompDoubleMap (const Standard_Integer theRep,
616 const Standard_Integer theSize)
617{
618 Standard_Integer i,j;
619 Standard_Integer iFail1=0, iFail2=0;
620
621 ////////////////////////////////Perf_Meter aNBind ("NCollection_DoubleMap binding",0);
622 ////////////////////////////////Perf_Meter aTBind ("TCollection_DoubleMap binding",0);
623 ////////////////////////////////Perf_Meter aNFind ("NCollection_DoubleMap finding",0);
624 ////////////////////////////////Perf_Meter aTFind ("TCollection_DoubleMap finding",0);
625 ////////////////////////////////Perf_Meter aNOper ("NCollection_DoubleMap operator=",0);
626 ////////////////////////////////Perf_Meter aTOper ("TCollection_DoubleMap operator=",0);
627 ////////////////////////////////Perf_Meter aNClea ("NCollection_DoubleMap clearing",0);
628 ////////////////////////////////Perf_Meter aTClea ("TCollection_DoubleMap clearing",0);
629 //////////////////////////////////Perf_Meter aNAssi ("NCollection_DoubleMap Assign",0);
630 for (i=0; i<theRep; i++)
631 {
632 ////////////////////////////////QANCollection_DoubleMap a1, a2;
633 QANCollection_DoubleMapPerf a1, a2;
634 ////////////////////////////////aNBind.Start();
635 PERF_START_METER("NCollection_DoubleMap binding")
636 for (j=1; j<=theSize; j++)
637 {
638 Key1Type aKey1;
639 Key2Type aKey2;
640 do {
641 Random(aKey1);
642 Random(aKey2);
643 iFail1++;
644 }
645 while (a1.IsBound1(aKey1) || a1.IsBound2(aKey2));
646 iFail1--;
647 a1.Bind(aKey1,aKey2);
648 }
649 ////////////////////////////////aNBind.Stop();
650 PERF_STOP_METER("NCollection_DoubleMap binding")
651 ////////////////////////////////aNFind.Start();
652 PERF_START_METER("NCollection_DoubleMap finding")
653 for (j=1; j<=theSize; j++)
654 {
655 Key1Type aKey1;
656 Key2Type aKey2;
657 Random(aKey1);
658 Random(aKey2);
659 a1.AreBound(aKey1,aKey2);
660 }
661 ////////////////////////////////aNFind.Stop();
662 PERF_STOP_METER("NCollection_DoubleMap finding")
663 ////////////////////////////////aNOper.Start();
664 PERF_START_METER("NCollection_DoubleMap operator=")
665 a2 = a1;
666 ////////////////////////////////aNOper.Stop();
667 PERF_STOP_METER("NCollection_DoubleMap operator=")
668 //aNAssi.Start();
669 //a2.Assign(a1);
670 //aNAssi.Stop();
671 ////////////////////////////////aNClea.Start();
672 PERF_START_METER("NCollection_DoubleMap clearing")
673 a2.Clear();
674 ////////////////////////////////aNClea.Stop();
675 PERF_STOP_METER("NCollection_DoubleMap clearing")
676 }
677
678 for (i=0; i<theRep; i++)
679 {
680 QANCollection_DoubleMapOfRealInteger a1, a2;
681 ////////////////////////////////aTBind.Start();
682 PERF_START_METER("TCollection_DoubleMap binding")
683 for (j=1; j<=theSize; j++)
684 {
685 Key1Type aKey1;
686 Key2Type aKey2;
687 do {
688 Random(aKey1);
689 Random(aKey2);
690 iFail2++;
691 }
692 while (a1.IsBound1(aKey1) || a1.IsBound2(aKey2));
693 iFail2--;
694 a1.Bind(aKey1,aKey2);
695 }
696 ////////////////////////////////aTBind.Stop();
697 PERF_STOP_METER("TCollection_DoubleMap binding")
698 ////////////////////////////////aTFind.Start();
699 PERF_START_METER("TCollection_DoubleMap finding")
700 for (j=1; j<=theSize; j++)
701 {
702 Key1Type aKey1;
703 Key2Type aKey2;
704 Random(aKey1);
705 Random(aKey2);
706 a1.AreBound(aKey1,aKey2);
707 }
708 ////////////////////////////////aTFind.Stop();
709 PERF_STOP_METER("TCollection_DoubleMap finding")
710 ////////////////////////////////aTOper.Start();
711 PERF_START_METER("TCollection_DoubleMap operator=")
712 a2 = a1;
713 ////////////////////////////////aTOper.Stop();
714 PERF_STOP_METER("TCollection_DoubleMap operator=")
715 ////////////////////////////////aTClea.Start();
716 PERF_START_METER("TCollection_DoubleMap clearing")
717 a2.Clear();
718 ////////////////////////////////aTClea.Stop();
719 PERF_STOP_METER("TCollection_DoubleMap clearing")
720 }
721 PERF_PRINT_ALL
722 if (iFail1 || iFail2)
723 cout << "Warning : N map failed " << iFail1 << " times, T map - " <<
724 iFail2 << endl;
725}
726
727// ===================== Test perform of IndexedMap type ==========================
728static void CompIndexedMap (const Standard_Integer theRep,
729 const Standard_Integer theSize)
730{
731 Standard_Integer i,j;
732
733 ////////////////////////////////Perf_Meter aNBind ("NCollection_IndexedMap adding",0);
734 ////////////////////////////////Perf_Meter aTBind ("TCollection_IndexedMap adding",0);
735 ////////////////////////////////Perf_Meter aNOper ("NCollection_IndexedMap operator=",0);
736 ////////////////////////////////Perf_Meter aTOper ("TCollection_IndexedMap operator=",0);
737 ////////////////////////////////Perf_Meter aNFind ("NCollection_IndexedMap finding",0);
738 ////////////////////////////////Perf_Meter aTFind ("TCollection_IndexedMap finding",0);
739 ////////////////////////////////Perf_Meter aNClea ("NCollection_IndexedMap clearing",0);
740 ////////////////////////////////Perf_Meter aTClea ("TCollection_IndexedMap clearing",0);
741 ////////////////////////////////Perf_Meter aNAssi ("NCollection_IndexedMap Assign",0);
742
743 for (i=0; i<theRep; i++)
744 {
745 ////////////////////////////////QANCollection_IndexedMap a1, a2;
746 QANCollection_IndexedMapPerf a1, a2;
747 ////////////////////////////////aNBind.Start();
748 PERF_START_METER("NCollection_IndexedMap adding")
749 for (j=1; j<=theSize; j++)
750 {
751 Key1Type aKey1;
752 Random(aKey1);
753 a1.Add(aKey1);
754 }
755 ////////////////////////////////aNBind.Stop();
756 PERF_STOP_METER("NCollection_IndexedMap adding")
757 ////////////////////////////////aNFind.Start();
758 PERF_START_METER("NCollection_IndexedMap finding")
759 for (j=1; j<=theSize; j++)
760 {
761 Key1Type aKey1;
762 Random(aKey1);
763 a1.Contains(aKey1);
764 }
765 ////////////////////////////////aNFind.Stop();
766 PERF_STOP_METER("NCollection_IndexedMap finding")
767 ////////////////////////////////aNOper.Start();
768 PERF_START_METER("NCollection_IndexedMap operator=")
769 a2 = a1;
770 ////////////////////////////////aNOper.Stop();
771 PERF_STOP_METER("NCollection_IndexedMap operator=")
772 ////////////////////////////////aNAssi.Start();
773 PERF_START_METER("NCollection_IndexedMap Assign")
774 a2.Assign(a1);
775 ////////////////////////////////aNAssi.Stop();
776 PERF_STOP_METER("NCollection_IndexedMap Assign")
777 ////////////////////////////////aNClea.Start();
778 PERF_START_METER("NCollection_IndexedMap clearing")
779 a2.Clear();
780 ////////////////////////////////aNClea.Stop();
781 PERF_STOP_METER("NCollection_IndexedMap clearing")
782 }
783
784 for (i=0; i<theRep; i++)
785 {
786 TColStd_IndexedMapOfReal a1, a2;
787 ////////////////////////////////aTBind.Start();
788 PERF_START_METER("TCollection_IndexedMap adding")
789 for (j=1; j<=theSize; j++)
790 {
791 Key1Type aKey1;
792 Random(aKey1);
793 a1.Add(aKey1);
794 }
795 ////////////////////////////////aTBind.Stop();
796 PERF_STOP_METER("TCollection_IndexedMap adding")
797 ////////////////////////////////aTFind.Start();
798 PERF_START_METER("TCollection_IndexedMap finding")
799 for (j=1; j<=theSize; j++)
800 {
801 Key1Type aKey1;
802 Random(aKey1);
803 a1.Contains(aKey1);
804 }
805 ////////////////////////////////aTFind.Stop();
806 PERF_STOP_METER("TCollection_IndexedMap finding")
807 ////////////////////////////////aTOper.Start();
808 PERF_START_METER("TCollection_IndexedMap operator=")
809 a2 = a1;
810 ////////////////////////////////aTOper.Stop();
811 PERF_STOP_METER("TCollection_IndexedMap operator=")
812 ////////////////////////////////aTClea.Start();
813 PERF_START_METER("TCollection_IndexedMap clearing")
814 a2.Clear();
815 ////////////////////////////////aTClea.Stop();
816 PERF_STOP_METER("TCollection_IndexedMap clearing")
817 }
818 PERF_PRINT_ALL
819}
820
821// ===================== Test perform of IndexedDataMap type ==========================
822static void CompIndexedDataMap (const Standard_Integer theRep,
823 const Standard_Integer theSize)
824{
825 Standard_Integer i,j;
826
827 ////////////////////////////////Perf_Meter aNBind ("NCollection_IndexedDataMap binding",0);
828 ////////////////////////////////Perf_Meter aTBind ("TCollection_IndexedDataMap binding",0);
829 ////////////////////////////////Perf_Meter aNFind ("NCollection_IndexedDataMap finding",0);
830 ////////////////////////////////Perf_Meter aTFind ("TCollection_IndexedDataMap finding",0);
831 ////////////////////////////////Perf_Meter aNOper ("NCollection_IndexedDataMap operator=",0);
832 ////////////////////////////////Perf_Meter aTOper ("TCollection_IndexedDataMap operator=",0);
833 ////////////////////////////////Perf_Meter aNClea ("NCollection_IndexedDataMap clearing",0);
834 ////////////////////////////////Perf_Meter aTClea ("TCollection_IndexedDataMap clearing",0);
835 //////////////////////////////////Perf_Meter aNAssi ("NCollection_IndexedDataMap Assign",0);
836
837 for (i=0; i<theRep; i++)
838 {
839 ////////////////////////////////QANCollection_IDMap a1, a2;
840 QANCollection_IDMapPerf a1, a2;
841 ////////////////////////////////aNBind.Start();
842 PERF_START_METER("NCollection_IndexedDataMap binding")
843 for (j=1; j<=theSize; j++)
844 {
845 Key1Type aKey1;
846 ItemType anItem;
847 Random(aKey1);
848 Random(anItem);
849 a1.Add(aKey1,anItem);
850 }
851 ////////////////////////////////aNBind.Stop();
852 PERF_STOP_METER("NCollection_IndexedDataMap binding")
853 ////////////////////////////////aNFind.Start();
854 PERF_START_METER("NCollection_IndexedDataMap finding")
855 for (j=1; j<=theSize; j++)
856 {
857 Key1Type aKey1;
858 Random(aKey1);
859 a1.Contains(aKey1);
860 }
861 ////////////////////////////////aNFind.Stop();
862 PERF_STOP_METER("NCollection_IndexedDataMap finding")
863 ////////////////////////////////aNOper.Start();
864 PERF_START_METER("NCollection_IndexedDataMap operator=")
865 a2 = a1;
866 ////////////////////////////////aNOper.Stop();
867 PERF_STOP_METER("NCollection_IndexedDataMap operator=")
868 //aNAssi.Start();
869 //a2.Assign(a1);
870 //aNAssi.Stop();
871 ////////////////////////////////aNClea.Start();
872 PERF_START_METER("NCollection_IndexedDataMap clearing")
873 a2.Clear();
874 ////////////////////////////////aNClea.Stop();
875 PERF_STOP_METER("NCollection_IndexedDataMap clearing")
876 }
877
878 for (i=0; i<theRep; i++)
879 {
880 QANCollection_IndexedDataMapOfRealPnt a1, a2;
881 ////////////////////////////////aTBind.Start();
882 PERF_START_METER("TCollection_IndexedDataMap binding")
883 for (j=1; j<=theSize; j++)
884 {
885 Key1Type aKey1;
886 ItemType anItem;
887 Random(aKey1);
888 Random(anItem);
889 a1.Add(aKey1,anItem);
890 }
891 ////////////////////////////////aTBind.Stop();
892 PERF_STOP_METER("TCollection_IndexedDataMap binding")
893 ////////////////////////////////aTFind.Start();
894 PERF_START_METER("TCollection_IndexedDataMap finding")
895 for (j=1; j<=theSize; j++)
896 {
897 Key1Type aKey1;
898 Random(aKey1);
899 a1.Contains(aKey1);
900 }
901 ////////////////////////////////aTFind.Stop();
902 PERF_STOP_METER("TCollection_IndexedDataMap finding")
903 ////////////////////////////////aTOper.Start();
904 PERF_START_METER("TCollection_IndexedDataMap operator=")
905 a2 = a1;
906 ////////////////////////////////aTOper.Stop();
907 PERF_STOP_METER("TCollection_IndexedDataMap operator=")
908 ////////////////////////////////aTClea.Start();
909 PERF_START_METER("TCollection_IndexedDataMap clearing")
910 a2.Clear();
911 ////////////////////////////////aTClea.Stop();
912 PERF_STOP_METER("TCollection_IndexedDataMap clearing")
913 }
914 PERF_PRINT_ALL
915}
916
917// ===================== Test perform of SparseArray type ==========================
918static void CompSparseArray (const Standard_Integer theRep, const Standard_Integer theSize)
919{
920 Standard_Integer i,j;
921 for (i=0; i<theRep; i++)
922 {
923 PERF_START_METER("NCollection_SparseArray creation")
924
925 NCollection_SparseArray<Standard_Integer> a1(theSize),a2(theSize);
926
927 PERF_STOP_METER("NCollection_SparseArray creation")
928
929 PERF_START_METER("NCollection_SparseArray filling")
930 for( j=0;j<theSize;j++ )
931 {
932 Standard_Integer iIndex;
933 Random(iIndex,theSize);
934 a1.SetValue(j,iIndex+1);
935 }
936
937 PERF_STOP_METER("NCollection_SparseArray filling")
938
939 PERF_START_METER("NCollection_SparseArray size")
940 Standard_Size sizeSparseArray=a1.Size();
941 (void)sizeSparseArray; // avoid compiler warning on unused variable
942 PERF_STOP_METER("NCollection_SparseArray size")
943
944 PERF_START_METER("NCollection_Array1 Assign")
945 a2.Assign(a1);
946 PERF_STOP_METER("NCollection_Array1 Assign")
947 PERF_START_METER("NCollection_SparseArray HasValue")
948 for (j=0; j<theSize; j++)
949 {
950 Standard_Integer iIndex;
951 Random(iIndex,theSize);
952 a2.HasValue(iIndex+1);
953 }
954 PERF_STOP_METER("NCollection_SparseArray HasValue")
955 PERF_START_METER("NCollection_SparseArray UnsetValue")
956 for (j=0; j<theSize; j++)
957 {
958 Standard_Integer iIndex;
959 Random(iIndex,theSize);
960 a1.UnsetValue(iIndex+1);
961 }
962 PERF_STOP_METER("NCollection_SparseArray UnsetValue")
963
964 PERF_START_METER("NCollection_SparseArray Clear")
965 a1.Clear();
966 a2.Clear();
967 PERF_STOP_METER("NCollection_SparseArray Clear")
968
969 }
970
971 PERF_PRINT_ALL
972}
973
974//=======================================================================
975//function : CheckArguments
976//purpose :
977//=======================================================================
978Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
979{
980 if ( argc != 3) {
981 di << "Usage : " << argv[0] << " Repeat Size" << "\n";
982 return 1;
983 }
984 Repeat = Draw::Atoi(argv[1]);
985 Size = Draw::Atoi(argv[2]);
986 if ( Repeat < 1 ) {
987 di << "Repeat > 0" << "\n";
988 return 1;
989 }
990 if ( Size < 1 ) {
991 di << "Size > 0" << "\n";
992 return 1;
993 }
994 return 0;
995}
996
997
998//=======================================================================
999//function : QANColPerfArray1
1000//purpose :
1001//=======================================================================
1002static Standard_Integer QANColPerfArray1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1003{
1004 Standard_Integer Repeat, Size;
1005 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1006 return 1;
1007 }
1008 CompArray1(Repeat,Size);
1009 return 0;
1010}
1011
1012//=======================================================================
1013//function : QANColPerfArray2
1014//purpose :
1015//=======================================================================
1016static Standard_Integer QANColPerfArray2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1017{
1018 Standard_Integer Repeat, Size;
1019 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1020 return 1;
1021 }
1022 CompArray2(Repeat,Size);
1023 return 0;
1024}
1025
1026//=======================================================================
1027//function : QANColPerfList
1028//purpose :
1029//=======================================================================
1030static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1031{
1032 Standard_Integer Repeat, Size;
1033 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1034 return 1;
1035 }
1036 CompList(Repeat,Size);
1037 return 0;
1038}
1039
1040//=======================================================================
1041//function : QANColPerfSequence
1042//purpose :
1043//=======================================================================
1044static Standard_Integer QANColPerfSequence(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1045{
1046 Standard_Integer Repeat, Size;
1047 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1048 return 1;
1049 }
1050 CompSequence(Repeat,Size);
1051 return 0;
1052}
1053
1054//=======================================================================
1055//function : QANColPerfMap
1056//purpose :
1057//=======================================================================
1058static Standard_Integer QANColPerfMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1059{
1060 Standard_Integer Repeat, Size;
1061 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1062 return 1;
1063 }
1064 CompMap(Repeat,Size);
1065 return 0;
1066}
1067
1068//=======================================================================
1069//function : QANColPerfDataMap
1070//purpose :
1071//=======================================================================
1072static Standard_Integer QANColPerfDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1073{
1074 Standard_Integer Repeat, Size;
1075 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1076 return 1;
1077 }
1078 CompDataMap(Repeat,Size);
1079 return 0;
1080}
1081
1082//=======================================================================
1083//function : QANColPerfDoubleMap
1084//purpose :
1085//=======================================================================
1086static Standard_Integer QANColPerfDoubleMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1087{
1088 Standard_Integer Repeat, Size;
1089 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1090 return 1;
1091 }
1092 CompDoubleMap(Repeat,Size);
1093 return 0;
1094}
1095
1096//=======================================================================
1097//function : QANColPerfIndexedMap
1098//purpose :
1099//=======================================================================
1100static Standard_Integer QANColPerfIndexedMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1101{
1102 Standard_Integer Repeat, Size;
1103 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1104 return 1;
1105 }
1106 CompIndexedMap(Repeat,Size);
1107 return 0;
1108}
1109
1110//=======================================================================
1111//function : QANColPerfIndexedDataMap
1112//purpose :
1113//=======================================================================
1114static Standard_Integer QANColPerfIndexedDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1115{
1116 Standard_Integer Repeat, Size;
1117 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1118 return 1;
1119 }
1120 CompIndexedDataMap(Repeat,Size);
1121 return 0;
1122}
1123
1124//=======================================================================
1125//function : QANColCheckSparseArray
1126//purpose :
1127//=======================================================================
1128static Standard_Integer QANColCheckSparseArray(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1129{
1130 Standard_Integer Repeat, Size;
1131 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
1132 return 1;
1133 }
1134 CompSparseArray(Repeat,Size);
1135 return 0;
1136}
1137
1138void QANCollection::CommandsPerf(Draw_Interpretor& theCommands) {
1139 const char *group = "QANCollection";
1140
1141 // from agvCollTest/src/CollectionEXE/PerfTestEXE.cxx
1142 theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
1143 theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
1144 theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
1145 theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
1146 theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);
1147 theCommands.Add("QANColPerfDataMap", "QANColPerfDataMap Repeat Size", __FILE__, QANColPerfDataMap, group);
1148 theCommands.Add("QANColPerfDoubleMap", "QANColPerfDoubleMap Repeat Size", __FILE__, QANColPerfDoubleMap, group);
1149 theCommands.Add("QANColPerfIndexedMap", "QANColPerfIndexedMap Repeat Size", __FILE__, QANColPerfIndexedMap, group);
1150 theCommands.Add("QANColPerfIndexedDataMap", "QANColPerfIndexedDataMap Repeat Size", __FILE__, QANColPerfIndexedDataMap, group);
1151
1152 theCommands.Add("QANColCheckSparseArray", "QANColCheckSparseArray Repeat Size", __FILE__, QANColCheckSparseArray, group);
1153
1154 return;
1155}
1156