Open
Description
The main context for this is well described by BurntSushi/memchr#156.
I think (in rough order of impact) we should:
- switch from
str.contains
to memchr - switch from
str.starts_with
to to hopefullymemchr
, otherwisequick_strings::starts_with
- there's no "what if the haystack is very long" concern since we're looking at the start of the string, so the difference betweenmemchr
andquick_strings
won't be as big, or even might be negative - switch from using
starts_with_ignore_ascii_case
toquick_strings::istarts_with
- same for
*ends_with
- switch from Regex to use
quick_strings::icontains
(copying the code) forILIKE
- maybe we have to check it's actually faster for large haystacks? - this might have the biggest impact in some scenarois, but me should be careful - to use those improvements, switch from some direct use of
str.contains
etc inlike.rs
to usePredicate
(I'm not suggesting that we make quick_strings
a dependency, it was just a scratch experiment, if we use any of that code we should copy it.
Metadata
Metadata
Assignees
Labels
No labels