Skip to content

Commit

Permalink
Extensions: Optimize build to remove most exports via SIDE_MODULE=2
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
carlopi authored and Mytherin committed Jan 29, 2024
1 parent bb62b45 commit 8e4d4bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build_loadable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ for ext_path in $(find "${INPUT_PATH}" -name '*.duckdb_extension')
do
ext_name=$(basename "$ext_path" .duckdb_extension)
echo "Building '$ext_name'..."
emcc "$ext_path" -sSIDE_MODULE=1 -o "${OUTPUT_PATH}/$ext_name.duckdb_extension.wasm" -O3
emcc "$ext_path" -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_""$ext_name""_init,_""$ext_name""_version" -o "${OUTPUT_PATH}/$ext_name.duckdb_extension.wasm" -O3
done

0 comments on commit 8e4d4bf

Please sign in to comment.