Skip to content

Rebuild Emscripten C/C++ workloads with emcc 6.0.13 - #324

Open
danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-emscripten-6
Open

danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-emscripten-6

Conversation

@danleh

@danleh danleh commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Part of #277.

Rebuild tsf-wasm, zlib-wasm, richards-wasm, argon2-wasm, HashSet-wasm, quicksort-wasm and gcc-loops-wasm with Emscripten 6.0.13 (Clang 24, Binaryen v133). The current builds use emcc 3.1.73, 4.0.0 (argon2) and 4.0.15 (HashSet). The benchmark sources do not change.

To review (8 files, +13/−5; the other 28 files are build.sh output, and each build.log records the emcc version):

  • All seven build.sh: pass -sINCOMING_MODULE_JS_API=wasmBinary,print,printErr,preRun,postRun,noInitialRun. Emscripten 6.0.2 dropped wasmBinary from the default list, and setting the list replaces the default.
  • gcc-loops-wasm/build.sh: link with em++. Emscripten 6.0.6 turned off DEFAULT_TO_CXX.
  • argon2-wasm/build.sh: export HEAPU32, which benchmark.js uses to write the salt. Emscripten 4.0.7 stopped exporting the heap views by default.
  • zlib-wasm/src/zpipe.c: build.sh downloads it from zlib.net, and version 1.5 changes only Windows code. Emscripten's zlib port moved from 1.2.13 to 1.3.2.

Binaries: since Emscripten 4.0 the default targets include bulk memory and non-trapping float-to-int, so memcpy and memset compile to memory.copy and memory.fill. The seven workloads shrink by 88 KB in total (quicksort −23%, richards −20%, gcc-loops −10%).

Engine requirements: bulk memory, non-trapping float-to-int, sign extension and BigInt integration, all shipped since Safari 15, Firefox 79 and Chrome 85.

Scores (measured on a Linux x64 workstation with jsvu shells, each test alone in a fresh shell, 6 rounds; change of the mean score, rounds won in parentheses, bold = statistically significant at 95% confidence; @kmiller68 may want to check on macOS / arm64):

Test d8 (15.9.60) jsc (325217) SpiderMonkey (160.0b3)
tsf-wasm +8.7% (6/6) −0.7% (2/6) −0.9% (3/6)
zlib-wasm +2.2% (5/6) +0.2% (3/6) +5.1% (6/6)
richards-wasm +1.7% (4/6) −0.5% (3/6) −1.0% (2/6)
argon2-wasm −2.4% (1/6) +3.3% (4/6) +0.1% (4/6)
HashSet-wasm +2.4% (3/6) +3.0% (6/6) +1.7% (5/6)
quicksort-wasm −3.1% (2/6) +0.8% (3/6) −2.8% (1/6)
gcc-loops-wasm +27.7% (6/6) +36.8% (6/6) +32.4% (6/6)
Geomean +4.9% (5/6) +5.5% (6/6) +4.4% (6/6)
First and Average subscores
Test d8 First / Average jsc First / Average SpiderMonkey First / Average
tsf-wasm −2.7% / +13.1% −11.3% / +8.4% −3.3% / −0.3%
zlib-wasm +4.5% / +0.2% −1.7% / +0.8% +9.3% / +3.5%
richards-wasm +0.1% / +3.0% +2.5% / −3.3% +7.6% / −3.9%
argon2-wasm +2.2% / −6.7% +2.3% / +4.1% −2.8% / +3.2%
HashSet-wasm +10.3% / −3.5% +1.9% / +1.9% −2.1% / +3.9%
quicksort-wasm −8.7% / −2.2% +0.4% / +2.6% −6.3% / −1.0%
gcc-loops-wasm +16.8% / +30.9% +33.1% / +36.9% +27.3% / +34.8%

Reproduce: cd workloads/<name> && ./build.sh with emsdk 6.0.13 active. A rebuild reproduces all committed files bit for bit; only the date in build.log changes.

Rebuild tsf-wasm, zlib-wasm, richards-wasm, argon2-wasm, HashSet-wasm,
quicksort-wasm and gcc-loops-wasm with Emscripten 6.0.13 (Clang 24,
Binaryen v133). The previous builds used emcc 3.1.73, 4.0.0 (argon2) and
4.0.15 (HashSet). The benchmark sources are unchanged.

Build script changes:
- Pass -sINCOMING_MODULE_JS_API=wasmBinary,print,printErr,preRun,postRun,
  noInitialRun. Emscripten 6.0.2 removed wasmBinary from the default
  list, and setting the list replaces the default.
- gcc-loops: use em++. Emscripten 6.0.6 turned off DEFAULT_TO_CXX, so
  C++ programs must link with em++.
- argon2: add HEAPU32 to EXPORTED_RUNTIME_METHODS. benchmark.js writes
  the salt through it, and Emscripten 4.0.7 stopped exporting the heap
  views by default.
- zlib: build.sh downloads src/zpipe.c from zlib.net, now version 1.5,
  which changes only Windows code. Emscripten's zlib port moved from
  1.2.13 to 1.3.2.

Since Emscripten 4.0 the default browser targets include bulk memory and
nontrapping float-to-int, so memcpy/memset compile to memory.copy and
memory.fill, and float-to-int conversions use trunc_sat. Since 4.0.10,
Wasm exports are called without JS trampolines.

Score change, d8 15.9.60 / jsc 325217 / SpiderMonkey 160.0b3 (each test
alone in a fresh shell, 6 rounds; higher is better):
  tsf-wasm         +8.7% /  -0.7% /  -0.9%
  zlib-wasm        +2.2% /  +0.2% /  +5.1%
  richards-wasm    +1.7% /  -0.5% /  -1.0%
  argon2-wasm      -2.4% /  +3.3% /  +0.1%
  HashSet-wasm     +2.4% /  +3.0% /  +1.7%
  quicksort-wasm   -3.1% /  +0.8% /  -2.8%
  gcc-loops-wasm  +27.7% / +36.8% / +32.4%
  Geomean          +4.9% /  +5.5% /  +4.4%

Part of WebKit#277.
@danleh
danleh requested review from eqrion and kmiller68 October 31, 2026 01:51
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit d8a9e50
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/6ae549c16d2a10e531d6a1bf
😎 Deploy Preview https://deploy-preview-324--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ Proxy