Case-Insensitive UTF-8 Search with AVX-512 🌾🪡🌾#286
Merged
ashvardanian merged 147 commits intomainfrom Dec 15, 2025
Merged
Conversation
The new tests detect a bug in handling inputs like "中ABC".
New behaviour differs for `str` and `bytes` args
This design is cleaner, but I'm not seeing any gains on AMD Zen5. Closes #240
ad2fd8d to
7e3dd35
Compare
Port pressure went down from 8+6 on p5 and p0 respectively, to 6+5.
Naive: 12 p5 Before: 10 p5 ops + 1 p0 op After: 8 p5 ops + 4 p0 ops
Combines XOR + VPTERNLOG + VPTESTNMB to reduce port pressure on Intel CPUs
Yields a 30% performance improvement in a such megakernels with sequential memory access pattern
150x improvement over PyICU `icu.StringSearch` baseline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Below are the performance numbers comparing the search throughput of unique "word" tokens across various languages of the Leipzig Wikipedia Corpora for a case-insensitive substring search that respects all Unicode 17.0 case-folding rules. This is arguably the only library providing full Unicode spec compliance for search operations besides the PCRE2 library, which is often order(s) of magnitude slower than even our serial baseline due to the extreme complexity of combining a complete RegEx engine with Unicode compliance.