aboutsummaryrefslogtreecommitdiff
path: root/src/regexp/exec_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/regexp/exec_test.go')
-rw-r--r--src/regexp/exec_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go
index cfc1e147c1..463fcf1848 100644
--- a/src/regexp/exec_test.go
+++ b/src/regexp/exec_test.go
@@ -672,9 +672,11 @@ func benchmark(b *testing.B, re string, n int) {
const (
easy0 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ$"
+ easy0i = "(?i)ABCDEFGHIJklmnopqrstuvwxyz$"
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) }
@@ -682,6 +684,11 @@ func BenchmarkMatchEasy0_1K(b *testing.B) { benchmark(b, easy0, 1<<10) }
func BenchmarkMatchEasy0_32K(b *testing.B) { benchmark(b, easy0, 32<<10) }
func BenchmarkMatchEasy0_1M(b *testing.B) { benchmark(b, easy0, 1<<20) }
func BenchmarkMatchEasy0_32M(b *testing.B) { benchmark(b, easy0, 32<<20) }
+func BenchmarkMatchEasy0i_32(b *testing.B) { benchmark(b, easy0i, 32<<0) }
+func BenchmarkMatchEasy0i_1K(b *testing.B) { benchmark(b, easy0i, 1<<10) }
+func BenchmarkMatchEasy0i_32K(b *testing.B) { benchmark(b, easy0i, 32<<10) }
+func BenchmarkMatchEasy0i_1M(b *testing.B) { benchmark(b, easy0i, 1<<20) }
+func BenchmarkMatchEasy0i_32M(b *testing.B) { benchmark(b, easy0i, 32<<20) }
func BenchmarkMatchEasy1_32(b *testing.B) { benchmark(b, easy1, 32<<0) }
func BenchmarkMatchEasy1_1K(b *testing.B) { benchmark(b, easy1, 1<<10) }
func BenchmarkMatchEasy1_32K(b *testing.B) { benchmark(b, easy1, 32<<10) }
@@ -697,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)`)