TLDR Dev · ARTICLES & TUTORIALS

DON'T STOP EARLY: CASE-FOLDING SOURCE CODE AT MEMORY SPEED

github.blog23 min read

Summary from the TLDR Dev newsletter

Case folding is an operation in text processing that makes sure strings differing only in case are treated as equal, but achieving this quickly at scale is a challenge. GitHub's code search engine, Blackbird, efficiently implements case folding by using a branch-free loop and byte-space arithmetic, enabling it to process ASCII characters at speeds exceeding 45 GiB/s on a single core.