diff options
author | Jim Meyering <meyering@fb.com> | 2016-09-27 08:22:00 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-09-27 08:22:14 -0700 |
commit | 0f31cd341971a443714c9e7937e4e6e7e7a3dc21 (patch) | |
tree | 060f1f1515870c77cfc3c720c2ac7ca4bd2d60d3 /tests/long-pattern-perf | |
parent | be82dc89948e7154c9367a0378364a78fb58b307 (diff) | |
download | grep-0f31cd341971a443714c9e7937e4e6e7e7a3dc21.tar.gz |
tests/long-pattern-perf: avoid false-failure due to cache speed
* tests/long-pattern-perf: This test would fail semi-consistently
on some systems, probably because the smaller regexp fit well
within cache, yet the larger one did not. In that case, there
was a relative speed difference greater than 20x and the test
would fail. Quadruple the sizes, to make that less likely.
Also, construct the 10x larger regexp directly from the smaller,
rather than relying on seq with endpoints to induce that
approximate size ratio. Reported by Bruce Dubbs in
https://lists.gnu.org/archive/html/grep-devel/2016-09/msg00013.html
Diffstat (limited to 'tests/long-pattern-perf')
-rwxr-xr-x | tests/long-pattern-perf | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/long-pattern-perf b/tests/long-pattern-perf index 0548f341..0a02e6f7 100755 --- a/tests/long-pattern-perf +++ b/tests/long-pattern-perf @@ -29,8 +29,9 @@ echo x > in || framework_failure_ # We could use seq -s '' (avoiding the tr filter), but I # suspect some version of seq does not honor that option. # Note that we want 10x the byte count (not line count) in the larger file. -seq 10000 20000 | tr -d '\012' > re || framework_failure_ -seq 10000 100000 | tr -d '\012' > re-10x || framework_failure_ +seq 10000 50000 | tr -d '\012' > r || framework_failure_ +cat r r r r r r r r r r > re-10x || framework_failure_ +mv r re || framework_failure_ base_ms=$(user_time_ 1 grep -f re in ) || fail=1 b10x_ms=$(user_time_ 1 grep -f re-10x in) || fail=1 |