Skip to content

Build optimized WASM release artifacts - #1

Merged
yshalsager merged 1 commit into
yshalsager:mainfrom
mustafa0x:build/optimize-wasm-release
Jul 17, 2026
Merged

Build optimized WASM release artifacts#1
yshalsager merged 1 commit into
yshalsager:mainfrom
mustafa0x:build/optimize-wasm-release

Conversation

@mustafa0x

Copy link
Copy Markdown
Collaborator

Summary

  • build the custom SQLite WASM bundle through SQLite's canonical optimized npm target instead of the default development target
  • install wabt in the release workflow so optimized artifacts are stripped correctly
  • reject generated loaders that contain Emscripten's heap-resize debug logging

Why

The default SQLite WASM Make target uses a development -O0 build. Its generated loader enables Emscripten runtime diagnostics and logs messages such as:

Heap resize call from 8388608 to 10092544 took ... msecs. Success: true

SQLite documents -Oz as its shipping configuration. Using the canonical npm target applies that configuration consistently and strips the WASM debug symbols.

In a local build against the pinned SQLite 3.53.2 source, sqlite3.wasm decreased from approximately 2.1 MB in the current development-built release to 991 KB, and the generated browser and Node loaders no longer contained the heap-resize diagnostic.

Verification

  • mise run playground:verify-wasm
  • mise run wasm:package
  • npm run smoke:node
  • confirmed Heap resize call from is absent from sqlite3.mjs and sqlite3-node.mjs

@yshalsager
yshalsager merged commit 6abd0a2 into yshalsager:main Jul 17, 2026
1 check passed
@mustafa0x
mustafa0x deleted the build/optimize-wasm-release branch July 17, 2026 11:09
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.

2 participants