First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 static RTest TheTest(_L("T_FoldPerf"));
20 #define ARRAY_SIZE(ar) (sizeof(ar) / (sizeof(ar[0])))
22 const TText16 KText16[] = {'1', 'f', 'A', 0x01D5, 'k', '5', 'g', 'U', 'W', 'q', 'a',
23 0x095E, 0x01D5, 'a', 'B', 'c', 'd', 'E', 'F', 0};
24 //0x095E - DEVANAGARI LETTER FA
25 //decomposed to: 0x092B 0x093C
26 //0x01D5 - LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
27 //decomposed to: 0x0075 0x0308 0x0304
29 _LIT16(KPlainText, "abcdefghijklmnopqrst");
32 @SYMTestCaseID SYSLIB-UNICODE-CT-0108
33 @SYMTestCaseDesc FindF - performance test
35 @SYMTestActions FindF - performance test
36 @SYMTestExpectedResults The test must not fail.
37 @SYMPREQ814 Optimise folded string comparisons.
39 static void FindF_PerformanceTest()
41 TheTest.Next(_L("FindF test"));
43 TBufC16<ARRAY_SIZE(KText16) - 1> text(KText16);
45 TBufC16<3> searchStr1(_L16("gUw"));
47 const TText16 searchText2[] = {0x01D5, 'A', 'b', 0};
48 TBufC16<ARRAY_SIZE(searchText2) - 1> searchStr2(searchText2);
50 const TText16 searchText3[] = {0x0075, 0x0308, 0x0304, 'A', 'b', 0};
51 TBufC16<ARRAY_SIZE(searchText3) - 1> searchStr3(searchText3);
53 const TText16 searchText4[] = {0x095E, 'd', 'A', 'b', 0};
54 TBufC16<ARRAY_SIZE(searchText4) - 1> searchStr4(searchText4);
56 const TText16 searchText5[] = {0x095E, 0x0055, 0x0308, 0x0304, 'A', 'b', 'C', 0};
57 TBufC16<ARRAY_SIZE(searchText5) - 1> searchStr5(searchText5);
59 TBufC16<4> searchStr6(_L16("CDEF"));
61 TUint timeStart = User::TickCount();
62 for(TInt i=0;i<10000;++i)
64 TInt res = text.FindF(searchStr1);
65 TheTest(res == 6);//searchStr1 starts at position 6
67 res = text.FindF(searchStr2);
70 res = text.FindF(searchStr3);
73 res = text.FindF(searchStr4);
74 TheTest(res == KErrNotFound);
76 res = text.FindF(searchStr5);
79 res = text.FindF(searchStr6);
82 TUint timeEnd = User::TickCount();
83 TheTest.Printf(_L("Time = %d ticks\n"), timeEnd - timeStart);
87 @SYMTestCaseID SYSLIB-UNICODE-CT-0109
88 @SYMTestCaseDesc MatchF - performance test
90 @SYMTestActions MatchF - performance test
91 @SYMTestExpectedResults The test must not fail.
92 @SYMPREQ814 Optimise folded string comparisons.
94 static void MatchF_PerformanceTest()
96 TheTest.Next(_L("MatchF test"));
98 TBufC16<ARRAY_SIZE(KText16) - 1> text(KText16);
100 TBufC16<11> searchStr1(_L16("*fa??5*W*a*"));
102 const TText16 searchText2[] = {'*', 0x01D5, 'A', '?', 'C', '*', 0};
103 TBufC16<ARRAY_SIZE(searchText2) - 1> searchStr2(searchText2);
105 const TText16 searchText3[] = {'*', 0x0075, 0x0308, 0x0304, '*', 'e', 'F', 0};
106 TBufC16<ARRAY_SIZE(searchText3) - 1> searchStr3(searchText3);
108 const TText16 searchText4[] = {'1', '*', 'A', 'b', '*', 0};
109 TBufC16<ARRAY_SIZE(searchText4) - 1> searchStr4(searchText4);
111 TBufC16<11> searchStr5(_L16("*fa?z5*W*a*"));
113 TBufC16<5> searchStr6(_L16("a?v?T"));
115 TUint timeStart = User::TickCount();
116 for(TInt i=0;i<10000;++i)
118 TInt res = text.MatchF(searchStr1);
121 res = text.MatchF(searchStr2);
124 res = text.MatchF(searchStr3);
127 res = text.MatchF(searchStr4);
130 res = text.MatchF(searchStr5);
131 TheTest(res == KErrNotFound);
133 res = text.MatchF(searchStr6);
134 TheTest(res == KErrNotFound);
136 TUint timeEnd = User::TickCount();
137 TheTest.Printf(_L("Time = %d ticks\n"), timeEnd - timeStart);
141 @SYMTestCaseID SYSLIB-UNICODE-CT-0110
142 @SYMTestCaseDesc CompareF - performance test
143 @SYMTestPriority High
144 @SYMTestActions CompareF - performance test
145 @SYMTestExpectedResults The test must not fail.
146 @SYMPREQ814 Optimise folded string comparisons.
148 static void CompareF_PerformanceTest()
150 TheTest.Next(_L("CompareF test"));
152 TBufC16<ARRAY_SIZE(KText16) - 1> text(KText16);
154 const TText16 text1[] = {'1', 'F', 'A', 0x01D5, 'k', '5', 'G', 'U', 'W', 'Q', 'A',
155 0x095E, 0x01D5, 'a', 'B', 'C', 'd', 'E', 'F', 0};
156 TBufC16<ARRAY_SIZE(text1) - 1> str1(text1);
158 TBufC16<19> str2(_L16("1234567890123456789"));
160 TBufC16<19> str3(_L16("1fA4G6789r1d34z6789"));
162 TUint timeStart = User::TickCount();
166 TInt res = text.CompareF(str1);
169 res = text.CompareF(str2);
172 res = text.CompareF(str3);
175 TUint timeEnd = User::TickCount();
176 TheTest.Printf(_L("1. Time = %d ticks\n"), timeEnd - timeStart);
178 TBufC16<20> str4(_L16("abc3456hijklmnopqrst"));
179 timeStart = User::TickCount();
182 TInt res = str4.CompareF(KPlainText);
185 timeEnd = User::TickCount();
186 TheTest.Printf(_L("2. Time = %d ticks\n"), timeEnd - timeStart);
191 @SYMTestCaseID SYSLIB-UNICODE-CT-0114
192 @SYMTestCaseDesc FindF(), CompareF(), MatchF() on plain (no combining characters) text
193 @SYMTestPriority High
194 @SYMTestActions Performance test
195 @SYMTestExpectedResults The test must not fail.
196 @SYMPREQ814 Optimise folded string comparisons.
198 static void PlainTextPerformanceTest()
200 TheTest.Next(_L("Plain text - performance test"));
205 TBufC16<20> str1(_L16("abcdefghijklmnopqrst"));
206 TBufC16<20> str2(_L16("abcDefghIjklmNOpqrsT"));
207 TBufC16<20> str3(_L16("abcDefghIjKlmNOp2rsT"));
209 TUint timeStart = User::TickCount();
212 res = KPlainText().CompareF(str1);
214 res = KPlainText().CompareF(str2);
216 res = KPlainText().CompareF(str3);
219 TUint timeEnd = User::TickCount();
220 TheTest.Printf(_L("CompareF() Time = %d ticks\n"), timeEnd - timeStart);
222 TBufC16<20> str4(_L16("gHiJk"));
223 TBufC16<20> str5(_L16("Opqr"));
224 TBufC16<20> str6(_L16("2rsT"));
226 timeStart = User::TickCount();
229 res = KPlainText().FindF(str4);
231 res = KPlainText().FindF(str5);
233 res = KPlainText().FindF(str6);
234 TheTest(res == KErrNotFound);
236 timeEnd = User::TickCount();
237 TheTest.Printf(_L("FindF() Time = %d ticks\n"), timeEnd - timeStart);
239 TBufC16<20> str7(_L16("*gHiJk*op??sT"));
240 TBufC16<20> str8(_L16("aBC*rst"));
241 TBufC16<20> str9(_L16("ab?D*2rsT"));
243 timeStart = User::TickCount();
246 res = KPlainText().MatchF(str7);
248 res = KPlainText().MatchF(str8);
250 res = KPlainText().MatchF(str9);
251 TheTest(res == KErrNotFound);
253 timeEnd = User::TickCount();
254 TheTest.Printf(_L("MatchF() Time = %d ticks\n"), timeEnd - timeStart);
256 TBufC16<21> str10(_L16("abcdefghijklmnopqrst"));
257 TBufC16<20> str11(_L16("*xyz*"));
258 TBufC16<20> str12(_L16("xyz"));
260 timeStart = User::TickCount();
263 res = str10.FindF(str12);
264 TheTest(res == KErrNotFound);
266 timeEnd = User::TickCount();
267 TheTest.Printf(_L("Nonmatching string. FindF() Time = %d ticks\n"), timeEnd - timeStart);
269 timeStart = User::TickCount();
272 res = str10.MatchF(str11);
273 TheTest(res == KErrNotFound);
274 res = str10.MatchF(str12);
275 TheTest(res == KErrNotFound);
277 timeEnd = User::TickCount();
278 TheTest.Printf(_L("Nonmatching string. MatchF() Time = %d ticks\n"), timeEnd - timeStart);
281 static void RunComparison_PerformanceTest(TInt aNumberOfTimes, TDesC& aOriginalText, TDesC& aToCompareText, TBool aCase, TInt aValue = 0)
288 // CompareF() case...
289 timeStart = User::TickCount();
291 for(i=0; i<aNumberOfTimes; ++i)
293 res = aOriginalText.CompareF(aToCompareText);
301 timeEnd = User::TickCount();
303 TheTest.Printf(_L("Time to run (x%d) 16-bit CompareF() = %d ticks\n"), aNumberOfTimes, timeEnd - timeStart);
305 // Check return value
307 TheTest(res == aValue);
310 timeStart = User::TickCount();
312 for(i=0; i<aNumberOfTimes; ++i)
314 res = aOriginalText.Compare(aToCompareText);
322 timeEnd = User::TickCount();
324 TheTest.Printf(_L("Time to run (x%d) 16-bit Compare() = %d ticks\n"), aNumberOfTimes, timeEnd - timeStart);
327 static void RunComparison_PerformanceTest(TInt aNumberOfTimes, TDesC8& aOriginalText, TDesC8& aToCompareText, TBool aCase, TInt aValue = 0)
334 // CompareF() case...
335 timeStart = User::TickCount();
337 for(i=0; i<aNumberOfTimes; ++i)
339 res = aOriginalText.CompareF(aToCompareText);
347 timeEnd = User::TickCount();
349 TheTest.Printf(_L("Time to run (x%d) 8-bit CompareF() = %d ticks\n"), aNumberOfTimes, timeEnd - timeStart);
351 // Check return value
353 TheTest(res == aValue);
356 timeStart = User::TickCount();
358 for(i=0; i<aNumberOfTimes; ++i)
360 res = aOriginalText.Compare(aToCompareText);
368 timeEnd = User::TickCount();
370 TheTest.Printf(_L("Time to run (x%d) 8-bit Compare() = %d ticks\n"), aNumberOfTimes, timeEnd - timeStart);
373 static void CompareVsCompareF_PerformanceTest()
375 TheTest.Next(_L("Compare verses CompareF test"));
377 // Declare variables...
379 TInt numberOfTimes = 100000;
381 const TText16 smallUnicodeText16[] = {0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5, 0}; // 5 Characters
383 const TText16 largeUnicodeText16[] = {0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
384 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
385 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
386 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
387 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
388 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
389 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
390 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
391 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
392 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5, 0}; // 50 Characters
394 const TText16 smallErrUnicodeTextLast16[] = {0x01D5, 0x0308, 0x0304, 0x095E, 'X', 0}; // 5 Characters
396 const TText16 smallErrUnicodeTextFirst16[] = {'X', 0x0308, 0x0304, 0x095E, 0x01D5, 0}; // 5 Characters
398 const TText16 largeErrUnicodeTextLast16[] = {0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
399 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
400 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
401 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
402 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
403 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
404 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
405 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
406 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
407 0x01D5, 0x0308, 0x0304, 0x095E, 'X', 0}; // 50 Characters
409 const TText16 largeErrUnicodeTextFirst16[] = {'X', 0x0308, 0x0304, 0x095E, 0x01D5,
410 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
411 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
412 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
413 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
414 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
415 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
416 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
417 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5,
418 0x01D5, 0x0308, 0x0304, 0x095E, 0x01D5, 0}; // 50 Characters
420 const TText16 smallMixedText16[] = {'A', 'B', 'C', 0x095E, 0x01D5, 0}; // 5 Characters
422 const TText16 largeMixedText16[] = {'A', 'B', 'C', 0x095E, 0x01D5,
423 'F', 'G', 'H', 'I', 'J',
424 'K', 'L', 'M', 'N', 'O',
425 'P', 'Q', 'R', 'S', 'T',
426 'U', 'V', 'W', 'X', 'Y',
427 'Z', '1', '2', '3', '4',
428 '5', '6', '7', '8', '9',
429 'a', 'b', 'c', 'd', 'e',
430 'f', 'g', 'h', 'i', 'j',
431 'k', 'l', 'm', 0x095E, 0x01D5, 0}; // 50 Characters
433 const TText16 smallErrMixedTextLast16[] = {'A', 'B', 'C', 0x095E, 0x0304, 0}; // 5 Characters
435 const TText16 smallErrMixedTextFirst16[] = {0x0304, 'B', 'C', 0x095E, 0x01D5, 0}; // 5 Characters
437 const TText16 largeErrMixedTextLast16[] = {'A', 'B', 'C', 0x095E, 0x01D5,
438 'F', 'G', 'H', 'I', 'J',
439 'K', 'L', 'M', 'N', 'O',
440 'P', 'Q', 'R', 'S', 'T',
441 'U', 'V', 'W', 'X', 'Y',
442 'Z', '1', '2', '3', '4',
443 '5', '6', '7', '8', '9',
444 'a', 'b', 'c', 'd', 'e',
445 'f', 'g', 'h', 'i', 'j',
446 'k', 'l', 'm', 0x095E, 0x0304, 0}; // 50 Characters
448 const TText16 largeErrMixedTextFirst16[] = {0x0304, 'B', 'C', 0x095E, 0x01D5,
449 'F', 'G', 'H', 'I', 'J',
450 'K', 'L', 'M', 'N', 'O',
451 'P', 'Q', 'R', 'S', 'T',
452 'U', 'V', 'W', 'X', 'Y',
453 'Z', '1', '2', '3', '4',
454 '5', '6', '7', '8', '9',
455 'a', 'b', 'c', 'd', 'e',
456 'f', 'g', 'h', 'i', 'j',
457 'k', 'l', 'm', 0x095E, 0x01D5, 0}; // 50 Characters
459 // (16-bit) Ascii Set of variables
461 TBufC16<50> oriAsciiLargeText(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
462 TBufC16<5> oriAsciiSmallText(_L("ABCDE"));
464 TBufC16<50> matchAsciiLargeText(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
465 TBufC16<5> matchAsciiSmallText(_L("ABCDE"));
467 TBufC16<50> nonMatchAsciiLargeTextLast(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnX"));
468 TBufC16<50> nonMatchAsciiLargeTextFirst(_L("XBCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
470 TBufC16<5> nonMatchAsciiSmallTextLast(_L("ABCDX"));
471 TBufC16<5> nonMatchAsciiSmallTextFirst(_L("XBCDE"));
473 // (8-bit) Ascii Set of variables
475 TBufC8<50> oriAsciiLargeText8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
476 TBufC8<5> oriAsciiSmallText8(_L8("ABCDE"));
478 TBufC8<50> matchAsciiLargeText8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
479 TBufC8<5> matchAsciiSmallText8(_L8("ABCDE"));
481 TBufC8<50> nonMatchAsciiLargeTextLast8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnX"));
482 TBufC8<50> nonMatchAsciiLargeTextFirst8(_L8("XBCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno"));
484 TBufC8<5> nonMatchAsciiSmallTextLast8(_L8("ABCDX"));
485 TBufC8<5> nonMatchAsciiSmallTextFirst8(_L8("XBCDE"));
487 // (16-bit) Unicode Set of variables
489 TBufC16<ARRAY_SIZE(largeUnicodeText16) - 1> oriUnicodeLargeText(largeUnicodeText16);
490 TBufC16<ARRAY_SIZE(smallUnicodeText16) - 1> oriUnicodeSmallText(smallUnicodeText16);
492 TBufC16<ARRAY_SIZE(largeUnicodeText16) - 1> matchUnicodeLargeText(largeUnicodeText16);
493 TBufC16<ARRAY_SIZE(smallUnicodeText16) - 1> matchUnicodeSmallText(smallUnicodeText16);
495 TBufC16<ARRAY_SIZE(largeErrUnicodeTextLast16) - 1> nonMatchUnicodeLargeTextLast(largeErrUnicodeTextLast16);
496 TBufC16<ARRAY_SIZE(largeErrUnicodeTextFirst16) - 1> nonMatchUnicodeLargeTextFirst(largeErrUnicodeTextFirst16);
498 TBufC16<ARRAY_SIZE(smallErrUnicodeTextLast16) - 1> nonMatchUnicodeSmallTextLast(smallErrUnicodeTextLast16);
499 TBufC16<ARRAY_SIZE(smallErrUnicodeTextFirst16) - 1> nonMatchUnicodeSmallTextFirst(smallErrUnicodeTextFirst16);
501 // (16-bit) Unicode/Ascii Set of variables
503 TBufC16<ARRAY_SIZE(largeMixedText16) - 1> oriMixedLargeText(largeMixedText16);
504 TBufC16<ARRAY_SIZE(smallMixedText16) - 1> oriMixedSmallText(smallMixedText16);
506 TBufC16<ARRAY_SIZE(largeMixedText16) - 1> matchMixedLargeText(largeMixedText16);
507 TBufC16<ARRAY_SIZE(smallMixedText16) - 1> matchMixedSmallText(smallMixedText16);
509 TBufC16<ARRAY_SIZE(largeErrMixedTextLast16) - 1> nonMatchMixedLargeTextLast(largeErrMixedTextLast16);
510 TBufC16<ARRAY_SIZE(largeErrMixedTextFirst16) - 1> nonMatchMixedLargeTextFirst(largeErrMixedTextFirst16);
512 TBufC16<ARRAY_SIZE(smallErrMixedTextLast16) - 1> nonMatchMixedSmallTextLast(smallErrMixedTextLast16);
513 TBufC16<ARRAY_SIZE(smallErrMixedTextFirst16) - 1> nonMatchMixedSmallTextFirst(smallErrMixedTextFirst16);
515 // Run performance tests...
517 TheTest.Printf(_L("\n====== (8-bit) Ascii Performance tests ======"));
519 // Matching (8-bit) Ascii
521 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Ascii Text\n"));
522 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, matchAsciiLargeText8, ETrue);
524 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Ascii Text\n"));
525 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, matchAsciiSmallText8, ETrue);
527 // Non Matching (8-bit) Ascii
529 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Large\n"));
530 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiLargeTextLast8, EFalse, -9);
532 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Large\n"));
533 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiLargeTextFirst8, EFalse, -23);
535 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Small\n"));
536 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiSmallTextLast8, EFalse, -19);
538 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Small\n"));
539 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiSmallTextFirst8, EFalse, -23);
541 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Small\n"));
542 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiSmallTextLast8, EFalse, -19);
544 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Small\n"));
545 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiSmallTextFirst8, EFalse, -23);
547 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Large\n"));
548 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiLargeTextLast8, EFalse, -45);
550 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Large\n"));
551 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiLargeTextFirst8, EFalse, -23);
553 // Mismatching length (8-bit) Ascii
555 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Length Mismatch / Small Vs Large\n"));
556 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, oriAsciiLargeText8, EFalse, -45);
558 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Length Mismatch / Large Vs Small\n"));
559 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, oriAsciiSmallText8, EFalse, 45);
561 TheTest.Printf(_L("\n====== (16-bit) Ascii Performance tests ======"));
563 // Matching (16-bit) Ascii
565 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Ascii Text\n"));
566 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, matchAsciiLargeText, ETrue);
568 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Ascii Text\n"));
569 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, matchAsciiSmallText, ETrue);
571 // Non Matching (16-bit) Ascii
573 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Large\n"));
574 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiLargeTextLast, EFalse, -9);
576 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Large\n"));
577 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiLargeTextFirst, EFalse, -23);
579 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Small\n"));
580 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiSmallTextLast, EFalse, -19);
582 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Small\n"));
583 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiSmallTextFirst, EFalse, -23);
585 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Small\n"));
586 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiSmallTextLast, EFalse, -19);
588 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Small\n"));
589 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiSmallTextFirst, EFalse, -23);
591 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Large\n"));
592 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiLargeTextLast, EFalse, -1);
594 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Large\n"));
595 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiLargeTextFirst, EFalse, -23);
597 // Mismatching length (16-bit) Ascii
599 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Length Mismatch / Small Vs Large\n"));
600 RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, oriAsciiLargeText, EFalse, -1);
602 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Length Mismatch / Large Vs Small\n"));
603 RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, oriAsciiSmallText, EFalse, 1);
605 TheTest.Printf(_L("\n====== (16-bit) Unicode Performance tests ======"));
607 // Matching (16-bit) Unicode
609 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Unicode Text\n"));
610 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, matchUnicodeLargeText, ETrue);
612 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Unicode Text\n"));
613 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, matchUnicodeSmallText, ETrue);
615 // Non Matching (16-bit) Unicode
617 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Last Char Diff / Large Vs Large\n"));
618 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeLargeTextLast, EFalse, -3);
620 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / First Char Diff / Large Vs Large\n"));
621 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeLargeTextFirst, EFalse, -3);
623 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Last Char Diff / Small Vs Small\n"));
624 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeSmallTextLast, EFalse, -3);
626 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / First Char Diff / Small Vs Small\n"));
627 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeSmallTextFirst, EFalse, -3);
629 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Last Char Diff / Large Vs Small\n"));
630 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeSmallTextLast, EFalse, -3);
632 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / First Char Diff / Large Vs Small\n"));
633 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeSmallTextFirst, EFalse, -3);
635 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Last Char Diff / Small Vs Large\n"));
636 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeLargeTextLast, EFalse, -1);
638 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / First Char Diff / Small Vs Large\n"));
639 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeLargeTextFirst, EFalse, -3);
641 // Mismatching length (16-bit) Unicode
643 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Length Mismatch / Small Vs Large\n"));
644 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, oriUnicodeLargeText, EFalse, -1);
646 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Length Mismatch / Large Vs Small\n"));
647 RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, oriUnicodeSmallText, EFalse, 1);
649 TheTest.Printf(_L("\n====== (16-bit) Mixed Performance tests ======"));
651 // Matching (16-bit) Mixed
653 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Mixed Text\n"));
654 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, matchMixedLargeText, ETrue);
656 TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Mixed Text\n"));
657 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, matchMixedSmallText, ETrue);
659 // Non Matching (16-bit) Mixed
661 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Last Char Diff / Large Vs Large\n"));
662 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedLargeTextLast, EFalse, -655);
664 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / First Char Diff / Large Vs Large\n"));
665 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedLargeTextFirst, EFalse, -675);
667 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Last Char Diff / Small Vs Small\n"));
668 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedSmallTextLast, EFalse, -655);
670 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / First Char Diff / Small Vs Small\n"));
671 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedSmallTextFirst, EFalse, -675);
673 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Last Char Diff / Large Vs Small\n"));
674 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedSmallTextLast, EFalse, -655);
676 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / First Char Diff / Large Vs Small\n"));
677 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedSmallTextFirst, EFalse, -675);
679 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Last Char Diff / Small Vs Large\n"));
680 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedLargeTextLast, EFalse, -1);
682 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / First Char Diff / Small Vs Large\n"));
683 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedLargeTextFirst, EFalse, -675);
685 // Mismatching length (16-bit) Mixed
687 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Length Mismatch / Small Vs Large\n"));
688 RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, oriMixedLargeText, EFalse, -1);
690 TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Length Mismatch / Large Vs Small\n"));
691 RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, oriMixedSmallText, EFalse, 1);
700 TheTest.Start(_L("Folding - performance tests"));
702 ::FindF_PerformanceTest();
703 ::MatchF_PerformanceTest();
704 ::CompareF_PerformanceTest();
705 ::PlainTextPerformanceTest();
706 ::CompareVsCompareF_PerformanceTest();