diff options
author | stephan <stephan@noemail.net> | 2022-11-29 18:28:40 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-11-29 18:28:40 +0000 |
commit | 72ee096775423c14ca340a1aee751d505d686557 (patch) | |
tree | 6fd81b393355bdf5d84ed63e7f39aa740c5cb470 /ext/wasm/api/sqlite3-api-opfs.js | |
parent | 6e86d5569d7bec69b548b893c2c8037cf97f3445 (diff) | |
download | sqlite-72ee096775423c14ca340a1aee751d505d686557.tar.gz sqlite-72ee096775423c14ca340a1aee751d505d686557.zip |
sqlite3.oo1.OpfsDb: default to journal_mode=persist, as current tests show it to be marginally faster than truncate/delete in Chrome v109. Also increase default busy_timeout from 2 seconds to 3, admittedly on a whim.
FossilOrigin-Name: d0c8fa30a31c691bc1be5e98d806eeb1e23a8fc6cd54d87e5c1b720aa936e707
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r-- | ext/wasm/api/sqlite3-api-opfs.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js index de7500afa..3099cb486 100644 --- a/ext/wasm/api/sqlite3-api-opfs.js +++ b/ext/wasm/api/sqlite3-api-opfs.js @@ -1216,12 +1216,14 @@ const installOpfsVfs = function callee(options){ sqlite3.oo1.DB.dbCtorHelper.setVfsPostOpenSql( opfsVfs.pointer, [ - /* Truncate journal mode is faster than delete or wal for - this vfs, per speedtest1. */ - "pragma journal_mode=truncate;", + /* Truncate journal mode is faster than delete for + this vfs, per speedtest1. That gap seems to have closed with + Chome version 108 or 109, but "persist" is very roughly 5-6% + faster than truncate in initial tests. */ + "pragma journal_mode=persist;", /* Set a default busy-timeout handler to help OPFS dbs deal with multi-tab/multi-worker contention. */ - "pragma busy_timeout=2000;", + "pragma busy_timeout=3000;", /* This vfs benefits hugely from cache on moderate/large speedtest1 --size 50 and --size 100 workloads. We currently |