Commit fc803874 authored by Michael Matloob's avatar Michael Matloob

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/24846Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 296b618d
...@@ -682,6 +682,7 @@ var benchData = []struct{ name, re string }{ ...@@ -682,6 +682,7 @@ var benchData = []struct{ name, re string }{
{"Medium", "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, {"Medium", "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$"},
{"Hard", "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$"}, {"Hard", "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$"},
{"Hard1", "ABCD|CDEF|EFGH|GHIJ|IJKL|KLMN|MNOP|OPQR|QRST|STUV|UVWX|WXYZ"}, {"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 { var benchSizes = []struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment