-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String search kernel optimisations #6107
Comments
I'm keen to try and work on this. |
Thanks @samuelcolvin I think in general the basic requirement for performance optimizations in this crate is benchmarks that show performance improvements to justify the additional code complexity / maintenance burden. I think there are already several |
I think @Dandandan and @jhorstmann are especailly execited by low level optimizations like this 😁 |
While working on this, I found #6145, we should merge that, then rebase and review the other PRs here. |
The main context for this is well described by BurntSushi/memchr#156.
I think (in rough order of impact) we should:
str.contains
to memchrstr.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 negativestarts_with_ignore_ascii_case
toquick_strings::istarts_with
*ends_with
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 carefulstr.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.The text was updated successfully, but these errors were encountered: