Show HN: SIMD Optimized Wasm Libc

3 ncruces 0 5/9/2025, 10:27:20 AM github.com ↗
It's been a little under a month since I submitted the initial bits of this: https://news.ycombinator.com/item?id=43730458

I was asked to upstream (which I tried to, it's the linked issue), and about additional functions.

Since then, the issue hasn't gained a lot of traction, but I implemented a few far more interesting algorithms, both by Wojciech Muła:

SIMDized check which bytes are in a set: http://0x80.pl/notesen/2018-10-18-simd-byte-lookup.html (for strspn and strcspn).

SIMD-friendly algorithms for substring searching: http://0x80.pl/notesen/2016-11-28-simd-strfind.html (for strstr and memmem).

These basically "complete" the set of string.h methods.

I also made sure the header compiles with C++, added a bunch of tests, and made it easier to integrate in your stuff if even it doesn't get upstreamed.

If you're interested in diving into the code, this is a direct link: https://github.com/ncruces/go-sqlite3/blob/main/sqlite3/libc...

Comments (0)

No comments yet