Remix.run Logo
inigyou 3 hours ago

TLDR: they implemented case folding with a lot more SIMD via autovectorization.

> almost every fold preserves the UTF-8 length or shrinks it, but two outliers grow—U+023A (Ⱥ) and U+023E (Ɀ) are 2 bytes each yet fold to 3-byte characters (ⱥ, ɀ)

Fix this by reversing it. Fold ⱥ to Ⱥ instead of the other way around. The search index won't only consist of lowercase characters any more, but that never mattered.

gwking 19 minutes ago | parent | next [-]

I wonder if making the index uppercase is strictly better in this sense, or if both upper and lowercase have chars that take more bytes.

Georgelemental an hour ago | parent | prev | next [-]

> The search index won't only consist of lowercase characters any more

This isn't the case anyway. Unicode case-folding has a few lowercase-to-uppercase mappings, e.g. Cherokee

persedes 2 hours ago | parent | prev | next [-]

This is a nice follow up to the other SIMD article that was posted here a week or so ago hah.

PaulDavisThe1st 3 hours ago | parent | prev [-]

[dead]