]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Make use of the --big-transactions flag in the speedtest1 JS apps.
authorstephan <stephan@noemail.net>
Thu, 8 Sep 2022 21:33:50 +0000 (21:33 +0000)
committerstephan <stephan@noemail.net>
Thu, 8 Sep 2022 21:33:50 +0000 (21:33 +0000)
FossilOrigin-Name: f2846dcbcaac7880394fb14597c3a60ed310419128c4c5b863cd771a7e5cdeb5

ext/wasm/speedtest1-worker.html
ext/wasm/speedtest1.html
manifest
manifest.uuid

index f537ccacf7fcf7b976007785d4691997f365b9c6..7f913be98b12641d99b628ca4eee30361d53d9d9 100644 (file)
            controls and some of them make little sense here
            (e.g. --script FILE). */
         flags["autovacuum"] = "Enable AUTOVACUUM mode";
+        flags["big-transactions"] = "Important for tests 410 and 510!";
         //flags["cachesize"] = "N       Set the cache size to N";
         flags["checkpoint"] = "Run PRAGMA wal_checkpoint after each test case";
         flags["exclusive"] = "Enable locking_mode=EXCLUSIVE";
         flags["verify"] = "Run additional verification steps.";
         flags["without"] = "rowid     Use WITHOUT ROWID where appropriate";
         const preselectedFlags = [
-          'singlethread',
-          'memdb'
+          'big-transactions',
+          'memdb',
+          'singlethread'
         ];
         Object.keys(flags).sort().forEach(function(f){
           const opt = document.createElement('option');
             case 'error': logErr(msg.data); break;
             case 'load-status': updateLoadStatus(msg.data); break;
             default:
-              logErr("Unhandled worker message type:",arguments[0]);
+              logErr("Unhandled worker message type:",msg);
               break;
         }
       };
index 97c210de28b7845f8f799aa53f452b585a859f9c..0f95145eb4a17e6585e28aa752e481ef63facc3e 100644 (file)
       block the UI until it finishes! Adding UI controls to manually configure and start it
       are TODO.</div>
     <div>Output is sent to the dev console because we cannot update the UI while the
-      speedtest is running unless/until we move the speedtest to a worker thread.</div>
+      speedtest is running unless/until we move the speedtest to a worker thread.
+    </div>
+      <div class='warning'>Achtung: running it with the dev tools open <em>drastically</em>
+        slows it down: by a factor of 2.5+. For faster results, keep the dev tools closed
+        when running it!
+    </div>
     <hr>
-    <div id='test-output'></div>
+    <div id='test-output'>
+    </div>
     <script src="common/whwasmutil.js"></script>
     <script src="common/SqliteTestUtil.js"></script>
     <script src="speedtest1.js"></script>
@@ -65,7 +71,7 @@
         opfsDir._ = undefined;
 
         const eOut = document.querySelector('#test-output');
-        const log2 = async function(cssClass,...args){
+        const log2 = function(cssClass,...args){
           const ln = document.createElement('div');
           if(cssClass) ln.classList.add(cssClass);
           ln.append(document.createTextNode(args.join(' ')));
           }
           const scope = wasm.scopedAllocPush();
           const dbFile = 0 ? "" : pDir+"/speedtest1.db";
-          try{
-            const argv = [
-              // TODO: accept flags via URL arguments and/or a
-              // UI control. A multi-SELECT element should do
-              // nicely.
-              "speedtest1",
-              "--singlethread",
-              "--nomutex",
-              "--memdb", // note that memdb trumps the filename arg
-              dbFile
-            ];
-            console.log("argv =",argv);
-            wasm.xCall('__main_argc_argv', argv.length,
-                       wasm.scopedAllocMainArgv(argv));
-          }finally{
-            wasm.scopedAllocPop(scope);
-            if(pDir) unlink(dbFile);
-          }
-        };
+          const argv = [
+            // TODO: accept flags via URL arguments and/or a
+            // UI control. A multi-SELECT element should do
+            // nicely.
+            "speedtest1",
+            "--singlethread",
+            "--nomutex",
+            "--nosync",
+            "--nomemstat",
+            "--big-transactions", // important for tests 410 and 510!
+            //"--memdb", // note that memdb trumps the filename arg
+            dbFile
+          ];
+          console.log("argv =",argv);
+          // These log messages are not emitted to the UI until after main() returns. Fixing that
+          // requires moving the main() call and related cleanup into a timeout handler.
+          log2('',"Starting native main() with flags:",argv.join(' '));
+          log2('',"This will take a while and the browser might warn about the runaway JS. Give it time.");
+          setTimeout(function(){
+              wasm.xCall('__main_argc_argv', argv.length,
+                         wasm.scopedAllocMainArgv(argv));
+              wasm.scopedAllocPop(scope);
+              if(pDir) unlink(dbFile);
+              log2('',"Done running native main(). Check dev console for output.");
+          }, 100);
+        }/*runTests()*/;
 
         self.sqlite3TestModule.print = log;
         self.sqlite3TestModule.printErr = logErr;
index ddf22774ddba320b3616f8f30221085427ee6e32..ff1338362f5121bb32b8bfea242bf14cc400dd88 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sspeedtest1\s--big-transactions\sflag\sto\scause\sits\slarge\stests\swhich\srely\son\simplicit\stransactions\sto\sbe\swrapped\sin\sBEGIN/COMMIT,\sper\s/chat\sdiscussion.\sAdded\sto\ssupport\sof\sthe\sWASMFS\sbuild,\swhich\sslows\sdown\ssignificantly\swhen\sthousands\sof\simplicit\stransactions\sare\sused.
-D 2022-09-08T21:09:42.601
+C Make\suse\sof\sthe\s--big-transactions\sflag\sin\sthe\sspeedtest1\sJS\sapps.
+D 2022-09-08T21:33:50.335
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -511,9 +511,9 @@ F ext/wasm/scratchpad-opfs-main.js 69e960e9161f6412fd0c30f355d4112f1894d6609eb43
 F ext/wasm/scratchpad-opfs-worker.html 66c1d15d678f3bd306373d76b61c6c8aef988f61f4a8dd40185d452f9c6d2bf5
 F ext/wasm/scratchpad-opfs-worker.js 3ec2868c669713145c76eb5877c64a1b20741f741817b87c907a154b676283a9
 F ext/wasm/scratchpad-opfs-worker2.js 5f2237427ac537b8580b1c659ff14ad2621d1694043eaaf41ae18dbfef2e48c0
-F ext/wasm/speedtest1-worker.html 22938a087c4cf0ef1a8711d675d851f3ca5f25c2ea5a2a68c548c3c032d4b841
+F ext/wasm/speedtest1-worker.html 23b91da39859b890d73b28bd74629442c6873f38dc4d7ca94cacdc1be1202fb1
 F ext/wasm/speedtest1-worker.js 356b9953add4449acf199793db9b76b11ee016021918d8daffd19f08ec68d305
-F ext/wasm/speedtest1.html 75b5ab41b29188e1c173e443c999ce70058a77f04aa6ba92603b89dc9064f66a
+F ext/wasm/speedtest1.html ffda8a118c09d5429bc34b1ddfd05a963b6786ac83f2deae4f5241c2f5437f83
 F ext/wasm/split-speedtest1-script.sh a3e271938d4d14ee49105eb05567c6a69ba4c1f1293583ad5af0cd3a3779e205 x
 F ext/wasm/sql/000-mandelbrot.sql 775337a4b80938ac8146aedf88808282f04d02d983d82675bd63d9c2d97a15f0
 F ext/wasm/sql/001-sudoku.sql 35b7cb7239ba5d5f193bc05ec379bcf66891bce6f2a5b3879f2f78d0917299b5
@@ -2019,8 +2019,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 5240fb4d795dea826f23cf5d2152b519f5a46f49bb2499ea868fa7c7f4ce788b
-R b4518397db2d29dbb2157e07b557b159
+P 51395c005da46b7fa5a5f28809dd8fea263a6bac2b1492759b3d5a5aa7d399ca
+R 838553aa9700f04488b76fccfa35dc26
 U stephan
-Z 5034bb533c4e0d8f568aa6b28ab174ab
+Z 42d1e2550cb35842fb99b726ce6e4b2a
 # Remove this line to create a well-formed Fossil manifest.
index 2ccc07423d8357630063383fb4b38d425d71f08c..8b41f7137e6fc1f4c1be25f7d22939f0cdfff3c9 100644 (file)
@@ -1 +1 @@
-51395c005da46b7fa5a5f28809dd8fea263a6bac2b1492759b3d5a5aa7d399ca
\ No newline at end of file
+f2846dcbcaac7880394fb14597c3a60ed310419128c4c5b863cd771a7e5cdeb5
\ No newline at end of file