Bug 1450907 - Spend less time benchmarking HasRTLChars. draft
authorHenri Sivonen <hsivonen@hsivonen.fi>
Tue, 03 Apr 2018 13:15:06 +0300
changeset 776548 3ffd3712eecb1c3fd10c179e2c9aed33a05a9daa
parent 774779 e3b2ddedc7f5f3af1bed5a7c06c72e38c7ef634b
child 776593 43ea52e0f511ece804ff14e7a44a9bd6ec406adc
push id104905
push userbmo:hsivonen@hsivonen.fi
push dateTue, 03 Apr 2018 10:18:04 +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
@@ -1577,43 +1577,43 @@ MOZ_GTEST_BENCH_F(Strings, PerfIsASCIIHu
 MOZ_GTEST_BENCH_F(Strings, PerfIsASCIIExample3, [this] {
     for (int i = 0; i < 100000; 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