From: Michael Matloob Date: Tue, 26 Apr 2016 19:28:17 +0000 (-0400) Subject: regexp: add a harder regexp to the benchmarks X-Git-Tag: go1.7beta1~457 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=70d95a488da89d268d0a61171ec389982a62184d;p=gostls13.git 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- 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)`)