duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.03k stars 113 forks source link

Extensions: Optimize build to remove most exports via SIDE_MODULE=2 #1601

Closed carlopi closed 5 months ago

carlopi commented 5 months ago

Improvement depends a lot on the extensions, can be 0-30%. For example, icu.duckdb_extension.wasm goes from 8.0MB to 6.3MB (uncompressed size)

carlopi commented 5 months ago

This is the linked PR in spatial: https://github.com/duckdb/duckdb_spatial/pull/234

carlopi commented 5 months ago

Also adding here, to be addressed in a future PR or at the Emscripten or even standardization level: duckdb-wasm extensions do not expose their symbol at the JavaScript level, so the exports do not need to have the actual mangled names as export names, but they could have unnamed export names.

EDIT: unnamed is not actually possible, but arbitrary export names.