-
Notifications
You must be signed in to change notification settings - Fork 2k
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
We should optimize the strpos implementation in two ways:
- When the needle is scalar, we can build a single
memmem::Finderand use it to search repeatedly. This is significantly faster than usingmemchr, it turns out, and the cost of constructing the finder is cheap because it is amortized over the batch. - We previously optimized
strposto usememchrfor searching when both haystack and needle are ASCII. That was needlessly conservative: UTF-8 is self-stabilizing, so it should be safe to usememchrto search for matches for any combination of ASCII and UTF-8 needle and haystack.
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request