Corrections to the xRead method for databases in the os_kv.c VFS so that it
correctly reads the header, and thus avoids unnecessary cache flushes. This
changes also includes an optimization to the header read logic.
stephan [Fri, 16 Sep 2022 02:30:49 +0000 (02:30 +0000)]
Add batch-runner-kvvfs.html, a kvvfs-specific build of batch-runner.html. Reduce the speedtest1 --size X value for the batch list generation to 5 so that the kvvfs batch runner can handle it.
stephan [Fri, 16 Sep 2022 02:28:03 +0000 (02:28 +0000)]
Remove --nosync flag from speedtest1-kvvfs.html, as that seems to be the trigger for the 'no such table: z1' error. That app now warns if that flag is passed to it via URL args.
stephan [Fri, 16 Sep 2022 01:05:19 +0000 (01:05 +0000)]
Add return value checks to kvstorageWrite(), necessary for recognizing storage-full errors in the JS binding. speedtest1-kvvfs.html runs successfully on localStorage with --size 1 to 6 and starts failing with storage shortage at --size 7.
stephan [Thu, 15 Sep 2022 06:42:41 +0000 (06:42 +0000)]
More work on the synchronous OPFS experimentation. Numerous wasm/js build tweaks. Add speeedtest-wasmfs.html, the wasmfs/opfs counterpart of speedtest1.html.
stephan [Tue, 13 Sep 2022 19:27:03 +0000 (19:27 +0000)]
Add/apply various kvvfs-specific utility APIs to the JS layer to assist in testing and analysis. Correct a backwards default arg check for sqlite3ApiBootstrap(). Add exports for sqlite3_db_handle(), sqlite3_file_control(), and the SQLITE_FCNTL_xxx enum.
stephan [Mon, 12 Sep 2022 12:39:28 +0000 (12:39 +0000)]
Initial build of kvvfs in wasm. It loads but cannot find the VFS for as-yet-unknown reasons (sqlite3 shell works fine), and most APIs throw "null function or function signature mismatch" from deep within wasm, presumably as a side effect of the "missing" VFS.
stephan [Sun, 11 Sep 2022 02:43:08 +0000 (02:43 +0000)]
Initial prototype impls of write/delete-key ops for the pending kvvfs which use sessionStorage or localStorage for db page storage. read-key op is pending.
stephan [Fri, 9 Sep 2022 04:50:18 +0000 (04:50 +0000)]
speedtest1 wasm: add a link in the worker variant which launches the main-thread variant with the selected CLI flags. Append collected stdout/stderr to the main-thread page after execution is finished to avoid having to open the dev tools (which inexplicably slows down wasm execution).
stephan [Thu, 8 Sep 2022 21:09:42 +0000 (21:09 +0000)]
Add speedtest1 --big-transactions flag to cause its large tests which rely on implicit transactions to be wrapped in BEGIN/COMMIT, per /chat discussion. Added to support of the WASMFS build, which slows down significantly when thousands of implicit transactions are used.
stephan [Thu, 8 Sep 2022 15:30:59 +0000 (15:30 +0000)]
Add speedtest1-worker.html, an interactive Worker-thread variant of speedtest1.html. Add ext/wasm/index.html to act as a gateway to the various test pages.
Add the tool/omittest-msvc.tcl script that will try to build using MSVC
using various compile-time options, to ensure that the compile-time options
all build without errors.
Enhance the pcache1 implementation so that during an xRekey operation if
another page already exists at the destination, that other page gets moved
to the source key.
Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables. See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].
In the query planner, add a heuristic that will reduce the cost of a full
table scan for a materialized view or subquery if the full scan is the
outer-most loop. This is shown to speed up some queries.
drh [Wed, 31 Aug 2022 15:04:42 +0000 (15:04 +0000)]
Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
overloads a page number and uses only the PENDING_BYTE page for temporary
storage.
drh [Tue, 30 Aug 2022 00:11:51 +0000 (00:11 +0000)]
Any function call can abort. Take this into account when deciding if a DML
statement needs a statement journal. See
[forum:/forumpost/9b9e4716c0d7bbd1|forum thread 9b9e4716c0d7bbd1] for more
information.
stephan [Mon, 29 Aug 2022 09:51:17 +0000 (09:51 +0000)]
Add begin/end comment markers to the test blocks in speedtest1 --script output to facilitate chopping up the output into chunks for JS-side processing.
stephan [Mon, 29 Aug 2022 08:04:55 +0000 (08:04 +0000)]
oo #1 api: correct a case where a null callback is called. Rename some vars for clarity. Increase wasm-side memory in order to be able to load the speedtest1 output.
drh [Sat, 27 Aug 2022 14:43:34 +0000 (14:43 +0000)]
Ensure that every pcache page always has either the PGHDR_DIRTY or the
PGHDR_CLEAN bit set, even during transient page reshuffling during btree
balancing.
stephan [Thu, 25 Aug 2022 13:27:52 +0000 (13:27 +0000)]
Consolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit less efficient but certainly easier for a client to deal with and lightens the maintenance burden.
stephan [Thu, 25 Aug 2022 11:39:12 +0000 (11:39 +0000)]
Refactor and expand the worker1 docs, consolidating them into the top of their file instead of scattered around the internals. Accommodate an API change from yesterday in demo-oo1.js.
stephan [Wed, 24 Aug 2022 20:57:37 +0000 (20:57 +0000)]
Change DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add DB.exec() rowMode option for fetching a specific column by name. Add result column names to worker1 exec() callback interface, as there's otherwise no way to get that info from a worker.
stephan [Wed, 24 Aug 2022 18:39:46 +0000 (18:39 +0000)]
Expand the worker1 'exec' op handling for per-row callbacks for API-level consistency and smooth some edges between worker1 core and worker1-promiser. Add worker1 'config-get' message to fetch the serializable parts of the sqlite3.config state. Improve the 'open' op's handling of the 'persistent' option (noting that we cannot yet test that case from a worker).
drh [Wed, 24 Aug 2022 17:59:00 +0000 (17:59 +0000)]
Add a mutex to the sqlite3_db_config() interface so that it is threadsafe
when two or more threads call it on the same database connection at the same
time.
stephan [Wed, 24 Aug 2022 14:50:10 +0000 (14:50 +0000)]
js: resolve the mysterious "extra" unhandled exception notification, caused by inadvertently forking one promise into two separate ones (failing to properly reassign a then() result). Fix a typo in new Worker 1 code which caused the DB(filename) name to be incorrect.
stephan [Wed, 24 Aug 2022 05:59:23 +0000 (05:59 +0000)]
More work on how to configure the sqlite3 JS API bootstrapping process from higher-level code. Initial version of sqlite3-worker1-promiser, a Promise-based proxy for the Worker API #1.
stephan [Wed, 24 Aug 2022 00:51:39 +0000 (00:51 +0000)]
The very basics of a Promise-based proxy for the Worker #1 API. Still requires considerable cleanup, testing, and a solution for the exec-callback-via-event-type-name problem.