]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
OPFS concurrency test: add a URL flag to enable/disable unlock-asap mode.
authorstephan <stephan@noemail.net>
Wed, 23 Nov 2022 20:49:08 +0000 (20:49 +0000)
committerstephan <stephan@noemail.net>
Wed, 23 Nov 2022 20:49:08 +0000 (20:49 +0000)
FossilOrigin-Name: 1c1bf22eadae2a5a7d4358e7cdd22641c2efb9296f42e7376749293b3a58b114

ext/wasm/tests/opfs/concurrency/test.js
ext/wasm/tests/opfs/concurrency/worker.js
manifest
manifest.uuid

index 27bc47b19d9a3cbfd4677c34d3d064d78c6ba8d6..cb9d4275beb2db588d26a2fe391132ae87c62bb9 100644 (file)
@@ -63,6 +63,9 @@
   options.interval = (
     urlArgsHtml.has('interval') ? +urlArgsHtml.get('interval') : 750
   ) || 750;
+  options.unlockAsap = (
+    urlArgsHtml.has('unlock-asap') ? +urlArgsHtml.get('unlock-asap') : 0
+  ) || 0;
   const workers = [];
   workers.post = (type,...args)=>{
     for(const w of workers) w.postMessage({type, payload:args});
     }
   };
 
-  stdout("Launching",options.workerCount,"workers...");
+  stdout("Launching",options.workerCount,"workers. Options:",options);
   workers.uri = (
     'worker.js?'
       + 'sqlite3.dir='+options.sqlite3Dir
       + '&interval='+options.interval
       + '&opfs-verbose='+options.opfsVerbose
+      + '&opfs-unlock-asap='+options.unlockAsap
   );
   for(let i = 0; i < options.workerCount; ++i){
     stdout("Launching worker...");
index 1a896e714eb7ba6e1098b33fccab25f936fc44f4..91aa0fa6fa2c4e1d8463699ac21dd84018d6fed8 100644 (file)
@@ -3,9 +3,12 @@ importScripts(
 );
 self.sqlite3InitModule().then(async function(sqlite3){
   const urlArgs = new URL(self.location.href).searchParams;
-  const wName = urlArgs.get('workerId') || Math.round(Math.random()*10000);
+  const options = {
+    workerName: urlArgs.get('workerId') || Math.round(Math.random()*10000),
+    unlockAsap: urlArgs.get('opfs-unlock-asap') || 0 /*EXPERIMENTAL*/
+  };
   const wPost = (type,...payload)=>{
-    postMessage({type, worker: wName, payload});
+    postMessage({type, worker: options.workerName, payload});
   };
   const stdout = (...args)=>wPost('stdout',...args);
   const stderr = (...args)=>wPost('stderr',...args);
@@ -44,7 +47,7 @@ self.sqlite3InitModule().then(async function(sqlite3){
   };
   const run = async function(){
     db = new sqlite3.oo1.DB({
-      filename: 'file:'+dbName,//+'?opfs-unlock-asap=1'/*EXPERIMENTAL*/,
+      filename: 'file:'+dbName+'?opfs-unlock-asap='+options.unlockAsap,
       flags: 'c',
       vfs: 'opfs'
     });
@@ -66,7 +69,7 @@ self.sqlite3InitModule().then(async function(sqlite3){
       try{
         db.exec({
           sql:"INSERT OR REPLACE INTO t1(w,v) VALUES(?,?)",
-          bind: [wName, new Date().getTime()]
+          bind: [options.workerName, new Date().getTime()]
         });
         //stdout("Set",prefix);
       }catch(e){
index d9cc7cb9d04bde6ebcbe4cd27739b6d10a6d2d0c..a6b0539bab32ec6b7091700ce1770ad57e3994b4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\san\sexperimental\sOPFS\sVFS-specific\sURI\sflag,\sopfs-unlock-asap,\swhich\stells\sthe\sVFS\sto\srelease\simplicit\slocks\sASAP.\sThis\spermits\shigher\sconcurrency\sbut\shurts\sperformance\sconsiderably.\sThis\smay\sor\smay\snot\sbe\sobsoleted\sby\sother\sconcurrency-related\sexperimentation.
-D 2022-11-23T19:03:22.450
+C OPFS\sconcurrency\stest:\sadd\sa\sURL\sflag\sto\senable/disable\sunlock-asap\smode.
+D 2022-11-23T20:49:08.427
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -553,8 +553,8 @@ F ext/wasm/tester1-worker.html 5ef353348c37cf2e4fd0b23da562d3275523e036260b51073
 F ext/wasm/tester1.c-pp.html 74aa9b31c75f12490653f814b53c3dd39f40cd3f70d6a53a716f4e8587107399
 F ext/wasm/tester1.c-pp.js 0c129495d057c77788b59715152d51f9bf9002ebbcce759ef8b028272ce3519d
 F ext/wasm/tests/opfs/concurrency/index.html bb9b0f6da86df34c67fa506db9c45b7c4cf0045a211611cc6b8d2b53fa983481
-F ext/wasm/tests/opfs/concurrency/test.js 5993c08657d547d3a26b78ff3480122aed2b7361823bc127e96e558931093aff
-F ext/wasm/tests/opfs/concurrency/worker.js e1b10dc5d96117ac58f4eedde97a970816adc60e007f0a0f20a41d880ab59ca9
+F ext/wasm/tests/opfs/concurrency/test.js 9a937068b66a0cfbb9cb6833cb001ce22f9d0f8f765775e3456860b05db21797
+F ext/wasm/tests/opfs/concurrency/worker.js 2a275c4983016365cac18c9105f1ac7bd2adbc7ad89cc91b363d722f2bb55cb5
 F ext/wasm/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd72273503ae7d5
 F ext/wasm/wasmfs.make 8fea9b4f3cde06141de1fc4c586ab405bd32c3f401554f4ebb18c797401a678d
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
@@ -2059,8 +2059,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 c5b7a9715a13b696ab3ee965aa0a310f59b65f07cecd72faa2e3504bfd8eb632
-R 37d44560e41f4eab685876e5b8c66c33
+P d23c917013485ec2793125221f3936b05c39d6eca941629fb819b6b4aa714520
+R ff8c3df82102d217683515f7779a95c4
 U stephan
-Z 1cab17b5c5d56b08d5be52571107da20
+Z 269769e48cdf286c8fb19455cdae3a52
 # Remove this line to create a well-formed Fossil manifest.
index 8365ac9b1af5c499eeed5bb96afb6fc7d81c7d69..bb0d09842b93a20da9b7a4d6b6210e08692bba02 100644 (file)
@@ -1 +1 @@
-d23c917013485ec2793125221f3936b05c39d6eca941629fb819b6b4aa714520
\ No newline at end of file
+1c1bf22eadae2a5a7d4358e7cdd22641c2efb9296f42e7376749293b3a58b114
\ No newline at end of file