emscripten-core / emscripten-core/emscripten

Using SIMD for `string.h`

Open
#24,654 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I wrote a few SIMD optimized versions of functions from [`string.h`](https://github.com/ncruces/go-sqlite3/blob/main/sqlite3/libc/string.h).

I'm using them in a project of mine that uses `wasi-sdk`, and as such, I'm working with them to upstream the work to `wasi-libc`; [`strlen`](https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/src/string/strlen.c) was the first one merged, after several rounds of reviews.

I've got some decent [results](https://github.com/WebAssembly/wasi-libc/issues/580#issuecomment-2864764025) on `wazero` (the runtime I've used) but the tests I did using `wasmtime` weren't too different. I assume browsers would similarly benefit.

The improvements are significant enough to be noticeable (by a few percent) in macro benchmarks of my project which is SQLite. I can only assume the browser version of SQLite could similarly benefit.

This issue is to figure out if it makes sense to bring these to Emscripten, and how.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.