summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/mb-non-UTF8-performance13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/mb-non-UTF8-performance b/tests/mb-non-UTF8-performance
index e8433d8e..fc371bd6 100755
--- a/tests/mb-non-UTF8-performance
+++ b/tests/mb-non-UTF8-performance
@@ -27,11 +27,16 @@ fail=0
# "expensive", making it less likely to be run by regular users.
expensive_
-# Make this large enough so that even on high-end systems
-# it incurs at least 5-10ms of user time.
-yes $(printf '%078d' 0) | head -400000 > in || framework_failure_
+# Make the input large enough so that even on high-end systems
+# the unibyte test takes at least 10ms of user time.
+n_lines=100000
+while :; do
+ yes $(printf '%078d' 0) | head -$n_lines > in || framework_failure_
+ ubyte_ms=$(LC_ALL=C user_time_ 1 grep -i foobar in) || fail=1
+ test $ubyte_ms -ge 10 && break
+ n_lines=$(expr $n_lines + 200000)
+done
-ubyte_ms=$(LC_ALL=C user_time_ 1 grep -i foobar in) || fail=1
require_JP_EUC_locale_
mbyte_ms=$(user_time_ 1 grep -i foobar in) || fail=1