Skip to content

sqlite3-wasm: rebuild SQLite 3.48.0 with emcc 6.0.13 - #327

Open
danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-sqlite-emcc6
Open

danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-sqlite-emcc6

Conversation

@danleh

@danleh danleh commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #277.

Rebuild sqlite3-wasm with Emscripten 6.0.13 (was 3.1.73). SQLite stays at 3.48.0 and benchmark.js does not change, so the benchmark runs the same SQL as in 3.0.

To review (2 files, +48/−1; the other 3 files are build output):

  • emscripten-4-post-load-init.patch (new, 41 lines) backports Module.runSQLite3PostLoadInit from SQLite 3.49.0. Emscripten 4.0 made the MODULARIZE factory async, which runs SQLite 3.48's --post-js init too late: EmscriptenModule.sqlite3 stays undefined, and the shells fail with "Cannot set properties of undefined (setting 'scriptInfo')". The patch changes only the JS glue.
  • build.sh applies the patch and passes INCOMING_MODULE_JS_API through EMCC_CFLAGS, as in Rebuild Emscripten C/C++ workloads with emcc 6.0.13 #324.

Binaries: speedtest1.wasm now uses bulk memory (271 memory.copy, 217 memory.fill) and is 14 KB smaller.

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)
sqlite3-wasm +15.2% (6/6) −0.2% (2/6) +11.7% (4/6)
First and Average subscores
Test d8 First / Average jsc First / Average SpiderMonkey First / Average
sqlite3-wasm +7.7% / +18.6% −6.7% / +4.7% +12.2% / +10.6%

Reproduce: cd workloads/sqlite3-wasm && ./build.sh with emsdk 6.0.13 active. A rebuild reproduces speedtest1.js and speedtest1.wasm bit for bit.

Updating SQLite itself to 3.54.1 is stacked in #328 so the compiler rebuild and the library update can be reviewed separately.

Rebuild with Emscripten 6.0.13 (was 3.1.73). SQLite stays at 3.48.0 and
benchmark.js is unchanged, so the benchmark runs the same SQL as before.

- Emscripten 4.0 made the MODULARIZE factory async, which runs SQLite
  3.48's --post-js init too late: EmscriptenModule.sqlite3 stays
  undefined, and the shells fail with "Cannot set properties of
  undefined (setting 'scriptInfo')". emscripten-4-post-load-init.patch
  backports Module.runSQLite3PostLoadInit from SQLite 3.49.0. It changes
  only the JS glue. Drop it when updating to SQLite 3.49.0 or later.
- Pass INCOMING_MODULE_JS_API through EMCC_CFLAGS, since Emscripten 6.0.2
  removed wasmBinary from the default list.

speedtest1.wasm now uses bulk memory (271 memory.copy, 217 memory.fill).

Score change, d8 (15.9.60) / jsc (325217) / SpiderMonkey (160.0b3) (each
test alone in a fresh shell, 6 rounds): +15.2% / -0.2% / +11.7%.

Part of WebKit#277.
@danleh
danleh requested review from eqrion and kmiller68 November 3, 2026 17:28
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit f8e1f5a
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/6aea19d429ee612d1e7f22c7
😎 Deploy Preview https://deploy-preview-327--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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be removed again in the followup https://github.com/WebKit/JetStream/pull/328/changes where the benchmark source is updated, so this backport is no longer necessary.

@danleh danleh added the v3.1 label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant