emscripten-core / emscripten-core/emscripten

Enable SIMD by default?

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

Description

Probably a little early given the state of browser support, but eventually we may want to do this. This would allow the autovectorizer to do things, even without explicit SIMD in the source files.

Looking at our benchmark suite, many benchmarks change size by less than 1%, some growing and some shrinking. A few change by larger amounts: base64 is 9% larger, lzma 7%, memops 3%, skinning 2%, while one shrinks by a lot: poppler by 7%. The last is actually the most realistic codebase, so I'm not sure what the average size change would be.

Only three benchmarks change in timing: skinning is **11% faster** (makes sense, as it is a highly-vectorizable loop, and I guess the autovectorizer does well there), poppler is **7% faster** (this surprised me but I double-checked), and zlib is **4% faster** (ditto). No benchmark gets worse.

Overall there is no clear benefit/loss in size, and a few things speed up nicely, so this seems useful.

I also saw no test failures among the benchmarks. cc @dschuff who had some ideas on testing.

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.