1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

wasm: minor text and build cleanups.

FossilOrigin-Name: 36ceef94e1935f5e85f79e489cd0ed265a77820fb68329c190794df5e076bf84
This commit is contained in:
stephan
2022-09-03 11:41:44 +00:00
parent 53f635df55
commit cdefd5d046
5 changed files with 33 additions and 21 deletions

View File

@ -167,9 +167,12 @@ $(post-js.js): $(post-jses) $(MAKEFILE)
########################################################################
# emcc flags for .c/.o/.wasm.
# emcc flags for .c/.o/.wasm/.js.
emcc.flags =
#emcc.flags += -v # _very_ loud but also informative about what it's doing
# -g is needed to keep -O2 and higher from creating broken JS via
# minification.
emcc.flags += -g
########################################################################
# emcc flags for .c/.o.
@ -181,6 +184,7 @@ emcc.cflags += -I. -I$(dir.top) # $(SQLITE_OPT)
########################################################################
# emcc flags specific to building the final .js/.wasm file...
emcc.jsflags := -fPIC
emcc.jsflags := --minify 0
emcc.jsflags += --no-entry
emcc.jsflags += -sMODULARIZE
emcc.jsflags += -sSTRICT_JS
@ -303,7 +307,11 @@ $(speedtest1.sql): $(speedtest1)
batch-runner.list: $(MAKEFILE) $(speedtest1.sql) $(dir.sql)/000-mandelbrot.sql
bash split-speedtest1-script.sh $(dir.sql)/speedtest1.sql
ls -1 $(dir.sql)/*.sql | grep -v speedtest1.sql | sort > $@
CLEAN_FILES += batch-runner.list $(dir.sql)/speedtest1*.sql
clean-batch:
rm -f batch-runner.list $(dir.sql)/speedtest1*.sql
# ^^^ we don't do this along with 'clean' because we clean/rebuild on
# a regular basis with different -Ox flags and rebuilding the batch
# pieces each time is an unnecessary time sink.
batch: batch-runner.list
all: batch

View File

@ -10,12 +10,11 @@
***********************************************************************
A basic batch SQL running for sqlite3-api.js. This file must be run in
A basic batch SQL runner for sqlite3-api.js. This file must be run in
main JS thread and sqlite3.js must have been loaded before it.
*/
'use strict';
(function(){
const T = self.SqliteTestUtil;
const toss = function(...args){throw new Error(args.join(' '))};
const warn = console.warn.bind(console);
@ -218,7 +217,7 @@
const url = URL.createObjectURL(b);
const a = document.createElement('a');
a.href = url;
a.download = 'batch-runner-metrics-'+((new Date().getTime()/1000) | 0)+'.csv';
a.download = 'batch-runner-js-'+((new Date().getTime()/1000) | 0)+'.csv';
this.logHtml("Triggering download of",a.download);
document.body.appendChild(a);
a.click();
@ -376,10 +375,10 @@
}
}, false);
this.e.btnExportMetrics.addEventListener('click', function(){
who.logHtml2('warning',"Metrics export is a Work in Progress. See output in dev console.");
who.logHtml2('warning',"Triggering download of metrics CSV. Check your downloads folder.");
who.downloadMetrics();
const m = who.metricsToArrays();
console.log("Metrics:",who.metrics, m);
//const m = who.metricsToArrays();
//console.log("Metrics:",who.metrics, m);
});
this.e.btnRunRemaining.addEventListener('click', async function(){
let v = who.e.selSql.value;

View File

@ -122,6 +122,11 @@
sqlite3InitModule() factory function.
*/
self.sqlite3TestModule = {
/**
Array of functions to call after Emscripten has initialized the
wasm module. Each gets passed the Emscripten module object
(which is _this_ object).
*/
postRun: [
/* function(theModule){...} */
],
@ -135,10 +140,10 @@
console.error.apply(console, Array.prototype.slice.call(arguments));
},
/**
Called by the module init bits to report loading
progress. It gets passed an empty argument when loading is
done (after onRuntimeInitialized() and any this.postRun
callbacks have been run).
Called by the Emscripten module init bits to report loading
progress. It gets passed an empty argument when loading is done
(after onRuntimeInitialized() and any this.postRun callbacks
have been run).
*/
setStatus: function f(text){
if(!f.last){