address comments

This commit is contained in:
Daniel Lehmann 2024-12-20 03:07:46 +01:00
parent e9a0738934
commit 1a769a406b
4 changed files with 12 additions and 12 deletions

View file

@ -1112,7 +1112,7 @@ class WasmBenchmark extends Benchmark {
oldConsoleLog = globalObject.console.log;
globalObject.print = globalObject.printErr = (...args) => {
if (verbose)
oldConsoleLog('Intercepted print: ', ...args);
oldConsoleLog('Intercepted print: ', ...args);
};
let Module = {
@ -1828,7 +1828,7 @@ const testPlans = [
files: [
"./sqlite3/polyfills.js",
"./sqlite3/build/jswasm/speedtest1.js",
"./sqlite3/runner.js",
"./sqlite3/benchmark.js",
],
preload: {
wasmBinary: "./sqlite3/build/jswasm/speedtest1.wasm"

View file

@ -20,8 +20,8 @@ See under "Alternative Source Code Formats" or search for "Snapshot of the compl
## Running in JS shells
The SQLite developers only maintain compatibility of the Wasm build for running inside browsers, so `runner.js` contains some polyfills to run it JavaScript shells (such as `d8` (V8), `js` (SpiderMonkey), and `jsc` (JavaScriptCore)).
Ideally, it should run just via `$shell runner.js` from the current directory.
The SQLite developers only maintain compatibility of the Wasm build for running inside browsers, so `benchmark.js` contains some polyfills to run it JavaScript shells (such as `d8` (V8), `js` (SpiderMonkey), and `jsc` (JavaScriptCore)).
Ideally, it should run just via `$shell benchmark.js` from the current directory.
To keep the shell runner and browser results consistent, the benchmark is configured to never use OPFS (Origin Private File System) as the underlying storage layer ("VFS" in SQLite), since that is not available in shells.
It might thus show slightly different performance characteristics compared to the upstream `speedtest1.html` running with OPFS.

View file

@ -3,14 +3,7 @@
// found in the LICENSE file.
const inJetStreamRunner = typeof globalThis.benchmarkTime !== "undefined";
if (inJetStreamRunner) {
// Use JetStream interception of `print()`, see `WasmBenchmark.prerunCode()`.
globalThis.console.debug =
globalThis.console.warn =
globalThis.console.error =
globalThis.console.log =
print;
} else {
if (!inJetStreamRunner) {
load("polyfills.js");
// Exports `sqlite3InitModule()` and contains the main code.

View file

@ -39,3 +39,10 @@ globalThis.URLSearchParams = Map;
// `self` global object.
globalThis.self = this;
globalThis.console = {
log: print,
debug: print,
warn: print,
error: print,
};