Bug 1450907 - Spend less time benchmarking HasRTLChars. draft
authorHenri Sivonen <hsivonen@hsivonen.fi>
Tue, 03 Apr 2018 13:15:06 +0300
changeset 776547 41e2e9e97ce44479399453358b4056281b8f3f00
parent 774779 e3b2ddedc7f5f3af1bed5a7c06c72e38c7ef634b
push id104904
push userbmo:hsivonen@hsivonen.fi
push dateTue, 03 Apr 2018 10:15:42 +0000
bugs1450907
milestone61.0a1
Bug 1450907 - Spend less time benchmarking HasRTLChars. This sets a new baseline for these benchmarks. MozReview-Commit-ID: 1BotMvQ8Rjg
xpcom/tests/gtest/TestStrings.cpp
--- a/xpcom/tests/gtest/TestStrings.cpp
+++ b/xpcom/tests/gtest/TestStrings.cpp
@@ -1570,50 +1570,50 @@ MOZ_GTEST_BENCH_F(Strings, PerfIsASCIIFi
 MOZ_GTEST_BENCH_F(Strings, PerfIsASCIIHundred, [this] {
     for (int i = 0; i < 200000; i++) {
       bool b = IsASCII(*BlackBox(&mHundredAsciiUtf8));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfIsASCIIExample3, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 10000; i++) {
       bool b = IsASCII(*BlackBox(&mExample3Utf8));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfHasRTLCharsExample3, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 5000; i++) {
       bool b = HasRTLChars(*BlackBox(&mExample3Utf16));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfHasRTLCharsDE, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 5000; i++) {
       bool b = HasRTLChars(*BlackBox(&mDeUtf16));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfHasRTLCharsRU, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 5000; i++) {
       bool b = HasRTLChars(*BlackBox(&mRuUtf16));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfHasRTLCharsTH, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 5000; i++) {
       bool b = HasRTLChars(*BlackBox(&mThUtf16));
       BlackBox(&b);
     }
 });
 
 MOZ_GTEST_BENCH_F(Strings, PerfHasRTLCharsJA, [this] {
-    for (int i = 0; i < 100000; i++) {
+    for (int i = 0; i < 5000; i++) {
       bool b = HasRTLChars(*BlackBox(&mJaUtf16));
       BlackBox(&b);
     }
 });
 
 } // namespace TestStrings