]> Cypherpunks.ru repositories - gostls13.git/commit
regexp: fix BenchmarkMatch_onepass_regex
authorRuss Cox <rsc@golang.org>
Tue, 2 Oct 2018 13:09:10 +0000 (09:09 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 11 Oct 2018 18:01:17 +0000 (18:01 +0000)
commit872a5479574f11d7ebe78118226f2a423e89c993
treea9ecb6a2535dca23ab7e0884358df881af27c78d
parente2d70b8b4b7a9450b66e3516f36e75f46b7fb80f
regexp: fix BenchmarkMatch_onepass_regex

This benchmark - in contrast to all other benchmarks - was
running the regexp match on 1-byte substrings of the input
instead of the entire input. Worse, it was doing so by preallocating
a slice of slices of every 1-byte substring. Needless to say,
this does not accurately reflect what happens when the regexp
matcher is given a large input.

Change-Id: Icd5b95f0e43f554a6b93164916745941366e03d6
Reviewed-on: https://go-review.googlesource.com/c/139778
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/regexp/exec_test.go