Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions workloads/sqlite3-wasm/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class Benchmark {
"--nomemstat",
"--big-transactions" /*important for tests 410 and 510!*/,
"--size", "2", // To speedup, default is 100 (and takes about 4s).
// Since SQLite 3.50, the default testset is the "mix1" list, which
// speedtest1 splits in place in a static buffer. Calling main() again in
// the same instance then runs only "main", so only the first iteration
// would run the other testsets. Run just "main" in every iteration.
"--testset", "main",
"--vfs", vfs, // See VFS comment above.
];

Expand Down
8 changes: 4 additions & 4 deletions workloads/sqlite3-wasm/build.log
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Built on 2025-01-21T15:10:24Z
Built on 2026-10-28T22:49:56Z

Toolchain versions
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.73 (ac676d5e437525d15df5fd46bc2c208ec6d376a3)
wasm-strip 1.0.34
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 6.0.13 (e13ee988ce3d87a738dd8f3661d02223308c412a)
wasm-strip 1.0.36

Getting sources from https://sqlite.org/2025/sqlite-src-3480000.zip
Getting sources from https://sqlite.org/2026/sqlite-src-3540100.zip

Building...
Copying files from sqlite-src-*/ext/wasm/ into build/
Expand Down
20 changes: 18 additions & 2 deletions workloads/sqlite3-wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ emcc --version | head -n1 | tee -a "$BUILD_LOG"
echo -e "wasm-strip $(wasm-strip --version)\n" | tee -a "$BUILD_LOG"

# Check https://sqlite.org/download.html and update the source link, if needed.
SQLITE_SRC_URL="https://sqlite.org/2025/sqlite-src-3480000.zip"
SQLITE_SRC_URL="https://sqlite.org/2026/sqlite-src-3540100.zip"
echo -e "Getting sources from $SQLITE_SRC_URL\n" | tee -a "$BUILD_LOG"
SQLITE_SRC_FILE="$(basename $SQLITE_SRC_URL)"
curl -o "$SQLITE_SRC_FILE" $SQLITE_SRC_URL
Expand All @@ -26,8 +26,24 @@ unzip "$SQLITE_SRC_FILE"
echo "Building..." | tee -a "$BUILD_LOG"
pushd sqlite-src-*/
./configure
# ext/wasm/GNUmakefile expects the amalgamation to exist already.
make sqlite3.c
cd ext/wasm
make dist
# Emscripten 6.0.2 removed `wasmBinary` from the default INCOMING_MODULE_JS_API
# list, and setting the list replaces the default, so name every Module property
# that benchmark.js and the speedtest1 glue code pass in.
# `make dist` no longer builds speedtest1, so build that target directly:
# - CC="cc -DSQLITE_DISABLE_INTRINSIC" builds the host c-pp preprocessor
# without GCC's __builtin_ceil/__builtin_floor, which at -O0 emit calls to
# libm's ceil()/floor() whereas GNUmakefile links c-pp without -lm.
# (speedtest1.wasm itself is compiled by emcc, not $(CC).)
# - WASM_CUSTOM_INSTANTIATE=0 uses Emscripten's loader instead of SQLite's
# fetch()-based one, which JS shells don't have.
# - emcc_opt=-Oz matches the optimization level that `make dist` used.
# - bin.wasm-opt= skips SQLite's extra `wasm-opt --all-features` pass, which
# makes current Binaryen emit compact imports (0x7f) that engines reject.
EMCC_CFLAGS="-sINCOMING_MODULE_JS_API=wasmBinary,print,printErr,preRun,postRun,noInitialRun" \
make speedtest1 CC="cc -DSQLITE_DISABLE_INTRINSIC" WASM_CUSTOM_INSTANTIATE=0 emcc_opt=-Oz bin.wasm-opt=
popd

echo "Copying files from sqlite-src-*/ext/wasm/ into build/" | tee -a "$BUILD_LOG"
Expand Down
Loading
Loading