Skip to content

Commit 1a769a4

Browse files
committed
address comments
1 parent e9a0738 commit 1a769a4

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

JetStreamDriver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ class WasmBenchmark extends Benchmark {
11121112
oldConsoleLog = globalObject.console.log;
11131113
globalObject.print = globalObject.printErr = (...args) => {
11141114
if (verbose)
1115-
oldConsoleLog('Intercepted print: ', ...args);
1115+
oldConsoleLog('Intercepted print: ', ...args);
11161116
};
11171117
11181118
let Module = {
@@ -1828,7 +1828,7 @@ const testPlans = [
18281828
files: [
18291829
"./sqlite3/polyfills.js",
18301830
"./sqlite3/build/jswasm/speedtest1.js",
1831-
"./sqlite3/runner.js",
1831+
"./sqlite3/benchmark.js",
18321832
],
18331833
preload: {
18341834
wasmBinary: "./sqlite3/build/jswasm/speedtest1.wasm"

sqlite3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ See under "Alternative Source Code Formats" or search for "Snapshot of the compl
2020

2121
## Running in JS shells
2222

23-
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)).
24-
Ideally, it should run just via `$shell runner.js` from the current directory.
23+
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)).
24+
Ideally, it should run just via `$shell benchmark.js` from the current directory.
2525

2626
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.
2727
It might thus show slightly different performance characteristics compared to the upstream `speedtest1.html` running with OPFS.

sqlite3/runner.js renamed to sqlite3/benchmark.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
// found in the LICENSE file.
44

55
const inJetStreamRunner = typeof globalThis.benchmarkTime !== "undefined";
6-
if (inJetStreamRunner) {
7-
// Use JetStream interception of `print()`, see `WasmBenchmark.prerunCode()`.
8-
globalThis.console.debug =
9-
globalThis.console.warn =
10-
globalThis.console.error =
11-
globalThis.console.log =
12-
print;
13-
} else {
6+
if (!inJetStreamRunner) {
147
load("polyfills.js");
158

169
// Exports `sqlite3InitModule()` and contains the main code.

sqlite3/polyfills.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ globalThis.URLSearchParams = Map;
3939

4040
// `self` global object.
4141
globalThis.self = this;
42+
43+
globalThis.console = {
44+
log: print,
45+
debug: print,
46+
warn: print,
47+
error: print,
48+
};

0 commit comments

Comments
 (0)