]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
JS: change the default OPFS VFS journal mode from PERSIST to DELETE, as DELETE is...
authorstephan <stephan@noemail.net>
Thu, 13 Jul 2023 01:51:16 +0000 (01:51 +0000)
committerstephan <stephan@noemail.net>
Thu, 13 Jul 2023 01:51:16 +0000 (01:51 +0000)
FossilOrigin-Name: a061a43e36b8f3cb7c465fd2e54cfcd9dceb07e232ee78602bbdd1818acd05ea

ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
manifest
manifest.uuid

index 07dfa0f960b0a7809945563dd96ebf296987c107..31099c7cec01953457e4f84c73bc58eb905307c5 100644 (file)
@@ -298,6 +298,7 @@ const installOpfsVfs = function callee(options){
        lock contention to free up.
     */
     state.asyncIdleWaitTime = 150;
+
     /**
        Whether the async counterpart should log exceptions to
        the serialization channel. That produces a great deal of
@@ -1089,7 +1090,7 @@ const installOpfsVfs = function callee(options){
        propagate any exception on error, rather than returning false.
     */
     opfsUtil.unlink = async function(fsEntryName, recursive = false,
-                                          throwOnError = false){
+                                     throwOnError = false){
       try {
         const [hDir, filenamePart] =
               await opfsUtil.getDirForFilename(fsEntryName, false);
@@ -1186,19 +1187,23 @@ const installOpfsVfs = function callee(options){
              contention. */
           sqlite3.capi.sqlite3_busy_timeout(oo1Db, 10000);
           sqlite3.capi.sqlite3_exec(oo1Db, [
-            /* Truncate journal mode is faster than delete for
-               this vfs, per speedtest1. That gap seems to have closed with
-               Chrome version 108 or 109, but "persist" is very roughly 5-6%
-               faster than truncate in initial tests.
+            /* As of July 2023, the PERSIST journal mode on OPFS is
+               somewhat slower than DELETE or TRUNCATE (it was faster
+               before Chrome version 108 or 109). TRUNCATE and DELETE
+               have very similar performance on OPFS.
 
-               For later analysis: Roy Hashimoto notes that TRUNCATE
-               and PERSIST modes may decrease OPFS concurrency because
-               multiple connections can open the journal file in those
-               modes:
+               Roy Hashimoto notes that TRUNCATE and PERSIST modes may
+               decrease OPFS concurrency because multiple connections
+               can open the journal file in those modes:
 
                https://github.com/rhashimoto/wa-sqlite/issues/68
+
+               Given that, and the fact that testing has not revealed
+               any appreciable difference between performance of
+               TRUNCATE and DELETE modes on OPFS, we currently (as of
+               2023-07-13) default to DELETE mode.
             */
-            "pragma journal_mode=persist;",
+            "pragma journal_mode=DELETE;",
             /*
               This vfs benefits hugely from cache on moderate/large
               speedtest1 --size 50 and --size 100 workloads. We
index 501a8cd76c25527dd26103b070d10e21a77ff6ca..5912114cbad550302e6354a8989993dcbbb3736a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sobsolete\sext/wasm/api/sqlite3-wasi.h.
-D 2023-07-13T01:48:53.998
+C JS:\schange\sthe\sdefault\sOPFS\sVFS\sjournal\smode\sfrom\sPERSIST\sto\sDELETE,\sas\sDELETE\sis\sfaster\sin\scurrent\sbrowsers.
+D 2023-07-13T01:51:16.511
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -502,7 +502,7 @@ F ext/wasm/api/sqlite3-api-worker1.js 9f32af64df1a031071912eea7a201557fe39b17386
 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
 F ext/wasm/api/sqlite3-opfs-async-proxy.js 961bbc3ccc1fa4e91d6519a96e8811ad7ae60173bd969fee7775dacb6eee1da2
 F ext/wasm/api/sqlite3-v-helper.js e5c202a9ecde9ef818536d3f5faf26c03a1a9f5192b1ddea8bdabf30d75ef487
-F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 05f2563ddebfdc7a0f0ac0eb7cb381bb72043299aae1600ba9367c12f52b3fcc
+F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js f42feb4f492f770330e95400d0ff9b03b90978f6bcc7f3b34ec4cb70b57dc40e
 F ext/wasm/api/sqlite3-wasm.c 12a096d8e58a0af0589142bae5a3c27a0c7e19846755a1a37d2c206352fbedda
 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js bc06df0d599e625bde6a10a394e326dc68da9ff07fa5404354580f81566e591f
 F ext/wasm/api/sqlite3-worker1.c-pp.js da509469755035e919c015deea41b4514b5e84c12a1332e6cc8d42cb2cc1fb75
@@ -2042,8 +2042,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 7c5ea02205a360a11fa9043be12c678eb7fe6f6a0b63b09a3dc976beae881e3f
-R 119e33c4ca65919c57a8b13cbaf75c29
+P f661a6e0c1ac081ee402e64590eabd427440db1b717be9166bdfc025d0b0d899
+R 68f402355eff532485c97ad92873be22
 U stephan
-Z ed73669b2c57061d23ff2e04c6cf3602
+Z e4c28ef3556be6a3a591892b05be6957
 # Remove this line to create a well-formed Fossil manifest.
index bca95f7257e87dee1aef437931d8992c6294aa77..74410aa9fdca220898f7690d8b87c54e2ac1ff6e 100644 (file)
@@ -1 +1 @@
-f661a6e0c1ac081ee402e64590eabd427440db1b717be9166bdfc025d0b0d899
\ No newline at end of file
+a061a43e36b8f3cb7c465fd2e54cfcd9dceb07e232ee78602bbdd1818acd05ea
\ No newline at end of file