Closed RyanMarcus closed 1 year ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
9a26422
) 83.38% compared to head (b8fbe12
) 83.39%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR uses
memchr
to add a fast path tolike_utf8_scalar
for when the pattern can be processed as a "contains" query. For example, if the pattern is%ABBA%
, then we can check to see if each string containsABBA
instead of building a regular expression.To measure the performance improvement from this fast path, I added a benchmark. Here are the results on my machine:
Since
memchr
does the state-of-the-art SIMD tricks (as far as I know), this technique should even be faster for "contains" queries than the glob-matching suggestion in #1295 .