diff options
author | Michael Matloob <matloob@golang.org> | 2016-07-11 14:59:03 -0600 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2016-07-11 21:03:09 +0000 |
commit | fc803874d3a509ddd99a897da1c6a62dc4ce631e (patch) | |
tree | dc87743593d73db9d48c50622e208877aeabba2c | |
parent | 296b618dc8c8f59d7327b4d322f7ceef4032d94b (diff) | |
download | go-fc803874d3a509ddd99a897da1c6a62dc4ce631e.tar.gz go-fc803874d3a509ddd99a897da1c6a62dc4ce631e.zip |
regexp: add the Fanout benchmark
This is a copy of the "FANOUT" benchmark recently added to RE2 with the
following comment:
// This has quite a high degree of fanout.
// NFA execution will be particularly slow.
Most of the benchmarks on the regexp package have very little fanout and
are designed for comparing the regexp package's NFA with backtracking
engines found in other regular expression libraries. This benchmark
exercises the performance of the NFA on expressions with high fanout.
Change-Id: Ie9c8e3bbeffeb1fe9fb90474ddd19e53f2f57a52
Reviewed-on: https://go-review.googlesource.com/24846
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/regexp/exec_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go index 69f187e38a..576862860a 100644 --- a/src/regexp/exec_test.go +++ b/src/regexp/exec_test.go @@ -682,6 +682,7 @@ var benchData = []struct{ name, re string }{ {"Medium", "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, {"Hard", "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, {"Hard1", "ABCD|CDEF|EFGH|GHIJ|IJKL|KLMN|MNOP|OPQR|QRST|STUV|UVWX|WXYZ"}, + {"Fanout", "(?:[\\x{80}-\\x{10FFFF}]?){100}[\\x{80}-\\x{10FFFF}]"}, } var benchSizes = []struct { |