logoalt Hacker News

ashvardanianyesterday at 1:37 PM5 repliesview on HN

This article is about the ugliest — but arguably the most important — piece of open-source software I’ve written this year. The write-up ended up long and dense, so here’s a short TL;DR:

I grouped all Unicode 17 case-folding rules and built ~3K lines of AVX-512 kernels around them to enable fully standards-compliant, case-insensitive substring search across the entire 1M+ Unicode range, operating directly on UTF-8 bytes. In practice, this is often ~50× faster than ICU, and also less wrong than most tools people rely on today—from grep-style utilities to products like Google Docs, Microsoft Excel, and VS Code.

StringZilla v4.5 is available for C99, C++11, Python 3, Rust, Swift, Go, and JavaScript. The article covers the algorithmic tradeoffs, benchmarks across 20+ Wikipedia dumps in different languages, and quick starts for each binding.

Thanks to everyone for feature requests and bug reports. I'll do my best to port this to Arm as well — but first, I'm trying to ship one more thing before year's end.


Replies

zvrtoday at 12:51 PM

Thank you for this, and congrats on your achievement!

dboonyesterday at 5:40 PM

This is exactly the kind of thankless software which the world operates on. It’s unfortunate that such fundamental code hasn’t already been vectorized or the gills, but thank you for doing so! It’s excellent work

Sesse__yesterday at 5:53 PM

> I grouped all Unicode 17 case-folding rules

But why are you using the case-folding rules and not the collation rules?

show 1 reply
adzmyesterday at 2:20 PM

This is a truly amazing accomplishment. Reading these kernels is a joy!

fatty_patty89yesterday at 1:59 PM

Thank you

do the go bindings require cgo?

show 1 reply