batch-runner.js: force WebSQL batches to not abort for a failed statement (necessary for apples-to-apples-ish benchmark comparisons).

FossilOrigin-Name: 60f0c5cb04d2baf8431e523434d8753e39377f4b2c6bad225c2e5487a4be419b
This commit is contained in:
stephan 2022-09-30 15:24:58 +00:00
parent dc6ae60226
commit 359d62395e
3 changed files with 20 additions and 11 deletions

View File

@ -184,6 +184,7 @@
let runner;
if('websql'===db.id){
const who = this;
runner = function(resolve, reject){
/* WebSQL cannot execute multiple statements, nor can it execute SQL without
an explicit transaction. Thus we have to do some fragile surgery on the
@ -217,7 +218,8 @@
tx.executeSql(s,[], ()=>{}, (t,e)=>{
console.error("WebSQL error",e,"SQL =",s);
who.logErr(e.message);
throw e;
//throw e;
return false;
});
metrics.stepTotal += performance.now() - t;
}
@ -230,7 +232,11 @@
const nextBatch = function(){
if(sqls.length){
console.log("websql sqls.length",sqls.length,'of',n);
db.handle.transaction(transaction, reject, nextBatch);
db.handle.transaction(transaction, (e)=>{
who.logErr("Ignoring and contiuing:",e.message)
//reject(e);
return false;
}, nextBatch);
}else{
resolve(who);
}
@ -240,7 +246,8 @@
}catch(e){
//this.gotErr = e;
console.error("websql error:",e);
reject(e);
who.logErr(e.message);
//reject(e);
}
}.bind(this);
}else{/*sqlite3 db...*/
@ -292,6 +299,7 @@
//this.gotErr = e;
reject(e);
}finally{
capi.sqlite3_exec(db.handle,"rollback;",0,0,0);
wasm.scopedAllocPop(stack);
}
}.bind(this);
@ -604,7 +612,8 @@
}/*run()*/
}/*App*/;
self.sqlite3TestModule.initSqlite3().then(function(sqlite3){
self.sqlite3TestModule.initSqlite3().then(function(sqlite3_){
sqlite3 = sqlite3_;
self.App = App /* only to facilitate dev console access */;
App.run(sqlite3);
});

View File

@ -1,5 +1,5 @@
C Expose\ssqlite3_msize()\sto\swasm.
D 2022-09-30T12:10:36.196
C batch-runner.js:\sforce\sWebSQL\sbatches\sto\snot\sabort\sfor\sa\sfailed\sstatement\s(necessary\sfor\sapples-to-apples-ish\sbenchmark\scomparisons).
D 2022-09-30T15:24:58.096
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -493,7 +493,7 @@ F ext/wasm/api/sqlite3-api-worker1.js d5d5b7fac4c4731c38c7e03f4f404b2a95c388a2a1
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
F ext/wasm/api/sqlite3-wasm.c 336389b23c9b83763177499e49a0967949c392b2f7d84fbbb52ad6678e159f18
F ext/wasm/batch-runner.html c363032aba7a525920f61f8be112a29459f73f07e46f0ba3b7730081a617826e
F ext/wasm/batch-runner.js a94dd0005b34cb4e654a799fbe6357a66070510bbbe5d116cf1a8d4f9901bd80
F ext/wasm/batch-runner.js ce92650a6681586c89bef26ceae96674a55ca5a9727815202ca62e1a00ff5015
F ext/wasm/common/SqliteTestUtil.js 647bf014bd30bdd870a7e9001e251d12fc1c9ec9ce176a1004b838a4b33c5c05
F ext/wasm/common/emscripten.css 3d253a6fdb8983a2ac983855bfbdd4b6fa1ff267c28d69513dd6ef1f289ada3f
F ext/wasm/common/testing.css 3a5143699c2b73a85b962271e1a9b3241b30d90e30d895e4f55665e648572962
@ -2029,8 +2029,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 8a7998709f859a562cf6829485cb9921f8823af0efabe003741348ab1169fb89
R 6289539b45a526ce95fc98c2c59f8773
P aa6ad34f3b693b554be58ee2895f79397162c5b8877c709653c8508fc625e8f4
R ee4d9e4b75d1595fd50d7230f8809959
U stephan
Z 68420fe602124bac34ea19b4b762f3c8
Z d21afcaefd67f3605743128101420e02
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
aa6ad34f3b693b554be58ee2895f79397162c5b8877c709653c8508fc625e8f4
60f0c5cb04d2baf8431e523434d8753e39377f4b2c6bad225c2e5487a4be419b