← Back to KHAO

Cursor · GitHub ·

What’s exited has no branch in its body and no early exit

2 min read

Compiled by KHAO Editorial — aggregated from 1 source. See llms.txt for citation guidance.

★ Tier-1 Source

Mona sits on a raised green block beside another block displaying a circular refresh-style icon.

A loop with no data-dependent control flow is trivially vectorizable: LLVM emits 16-byte-at-a-time NEON and the whole thing runs at > 45 GiB/s —memory bandwidth.

Key facts

Summary

Suppose a user searches for café and your corpus contains CAFÉ, or they type straße and you’ve stored STRASSE. It’s a basic operation, but at GitHub they run it a lot. This post is about how they made it fast, and it starts somewhere counterintuitive: the biggest win in the ASCII fast path came from removing an optimization, not adding one. It is tempting to reach for str::to_lowercase, but lowercasing and folding are different operations with different goals:. Lowercasing is for display, and it’s locale- and context-sensitive: Greek final sigma lowercases to ς at the end of a word and σ elsewhere, and Turkish the reporter lowercases differently than English the reporter.

Read full article at GitHub Blog →

#Cursor #GitHub