BlogsGitHubCase Folding for Code Search

Case Folding for Code Search

Case Folding for Code Search

1
posts
2026

This feature thread tracks the evolution of case folding for code search. Initially, the focus was on basic case-insensitive matching. This post details significant performance optimizations for case folding, particularly for ASCII characters, by removing early exits and optimizing for vectorization. It also covers efficient handling of Unicode case folding and memory management to avoid unnecessary allocations.

2026

Don't stop early: Case-folding source code at memory speed

7/31/2026

This post details optimizations for case folding in GitHub's code search engine, Blackbird. It introduces a branchless ASCII case folding implementation that achieves memory bandwidth speeds by removing early exits and leveraging vectorization. It also discusses efficient Unicode case folding by using a compact data structure and strategies for memory management to avoid heap allocations, including reserving capacity for potential string growth.