code /
re2 /
d873b743f4ddd4c9d2156e8c34e47b682606d59f Avoid another copy in RE2::PossibleMatchRange, and simplify the code.
Again, this improves the case when the prefix is a large proportion of
maxlen. Gains are ~20% in this case.
Before:
Benchmark Time(ns) CPU(ns) Iterations
-------------------------------------------------------------------
PossibleMatchRange_Trivial 1158 1156 513274
PossibleMatchRange_Complex 2593 2589 272939
PossibleMatchRange_Prefix 71.1 71.0 9838330
PossibleMatchRange_NoProg 71.3 71.2 9844569
After:
Benchmark Time(ns) CPU(ns) Iterations
-------------------------------------------------------------------
PossibleMatchRange_Trivial 1134 1132 617832
PossibleMatchRange_Complex 2545 2542 276152
PossibleMatchRange_Prefix 56.5 56.4 10000000
PossibleMatchRange_NoProg 57.7 57.6 10000000
Change-Id: Ie3c6c4ea0b4de3575675fbca4856734a5f5120cc
Reviewed-on: https://code-review.googlesource.com/17730
Reviewed-by: Paul Wankadia <junyer@google.com>
4 files changed