]> Cypherpunks repositories - gostls13.git/commitdiff
regexp: add a harder regexp to the benchmarks
authorMichael Matloob <matloob@golang.org>
Tue, 26 Apr 2016 19:28:17 +0000 (15:28 -0400)
committerMichael Matloob <matloob@golang.org>
Wed, 27 Apr 2016 16:40:22 +0000 (16:40 +0000)
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>

src/regexp/exec_test.go

index f8f5f4020e05aa8fff714b0f1e476880479cd7d7..463fcf18484d8afc3527f8dddd46b9a214fa1d90 100644 (file)
@@ -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)`)