diff options
author | Michael Matloob <matloob@golang.org> | 2016-04-26 15:28:17 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2016-04-27 16:40:22 +0000 |
commit | 70d95a488da89d268d0a61171ec389982a62184d (patch) | |
tree | 700f1d1585bba149d22e4d4b4a6aa3718267bb1e /src/regexp/exec_test.go | |
parent | 9629f55fbbfb4052ea24c247cbd5db49ba2f389e (diff) | |
download | go-git-70d95a488da89d268d0a61171ec389982a62184d.tar.gz |
regexp: add a harder regexp to the benchmarks
This regexp has many parallel alternations
Change-Id: I8044f460aa7d18f20cb0452e9470557b87facd6d
Reviewed-on: https://go-review.googlesource.com/22471
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/regexp/exec_test.go')
-rw-r--r-- | src/regexp/exec_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go index f8f5f4020e..463fcf1848 100644 --- a/src/regexp/exec_test.go +++ b/src/regexp/exec_test.go @@ -676,6 +676,7 @@ const ( easy1 = "A[AB]B[BC]C[CD]D[DE]E[EF]F[FG]G[GH]H[HI]I[IJ]J$" medium = "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$" hard = "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$" + hard1 = "ABCD|CDEF|EFGH|GHIJ|IJKL|KLMN|MNOP|OPQR|QRST|STUV|UVWX|WXYZ" ) func BenchmarkMatchEasy0_32(b *testing.B) { benchmark(b, easy0, 32<<0) } @@ -703,6 +704,11 @@ func BenchmarkMatchHard_1K(b *testing.B) { benchmark(b, hard, 1<<10) } func BenchmarkMatchHard_32K(b *testing.B) { benchmark(b, hard, 32<<10) } func BenchmarkMatchHard_1M(b *testing.B) { benchmark(b, hard, 1<<20) } func BenchmarkMatchHard_32M(b *testing.B) { benchmark(b, hard, 32<<20) } +func BenchmarkMatchHard1_32(b *testing.B) { benchmark(b, hard1, 32<<0) } +func BenchmarkMatchHard1_1K(b *testing.B) { benchmark(b, hard1, 1<<10) } +func BenchmarkMatchHard1_32K(b *testing.B) { benchmark(b, hard1, 32<<10) } +func BenchmarkMatchHard1_1M(b *testing.B) { benchmark(b, hard1, 1<<20) } +func BenchmarkMatchHard1_32M(b *testing.B) { benchmark(b, hard1, 32<<20) } func TestLongest(t *testing.T) { re, err := Compile(`a(|b)`) |