The oldest trick in the ASCII book
Apr 12, 2015John Graham-Cumming

Summary
This post introduces a low-level optimization technique for case-insensitive string comparison using bitwise AND operations (AND 0xDF). This technique is particularly relevant for high-performance scenarios like processing millions of DNS packets per second, where efficient filtering decisions are crucial. It highlights how understanding ASCII character encoding can lead to significant performance gains in network protocols that use USASCII characters.
More from the DNS Infrastructure & Naming Conventions trail
- The keys to the Internet change on October 11, 2026. Are you ready?
- 1.1.1.1 now supports post-quantum DNSSEC, all 2,420 bytes of it
- How we saved 100 terabytes of memory by optimizing 1.1.1.1’s DNS cache
- BGP ORIGIN attribute manipulation and its impact on the Internet
- Cloudflare Internal DNS is now generally available