Change the debugging "json_parse(X)" function so that it shows a more
complete description of the JsonParse object on standard output and returns
the mimified JSON. Former behavior was to return the text of a decode
of the aNode array.
stephan [Wed, 26 Jul 2023 11:41:41 +0000 (11:41 +0000)]
Remove the batch SQL runner from the JS build's 'all' target, as it's long-since unused and adds noticable build time. Add makefile comments about JSPI.
stephan [Wed, 26 Jul 2023 11:11:39 +0000 (11:11 +0000)]
Add SAHPoolUtil.getFileNames() method, and tests for it, per [forum:a3da1e34d8|forum feedback]. Add a test to demonstrate that two SAH pools can coexist so long as they have different names.
Add the concept of an RCStr string - a "Reference Counted String". Use
these to keep track of big JSON strings that might need to be used in
multiple places at the same time with different lifetimes. Add two
different JSON string values to each parse - one with and one without
changes. The net result is a large reduction in the number of parses
that occur when doing an UPDATE of a indexed JSON field using
json_replace() or similar.
Add the JsonParse.zAlt field to old revised JSON text after a change.
Demonstrate that this elminates the need for reparsing after a change
by using it in the json_remove() function. This is an incremental check-in
containing lots of cruft.
stephan [Sun, 23 Jul 2023 22:14:41 +0000 (22:14 +0000)]
When writing the filename header in a opfs-sahpool file, ensure that all remaining bytes in that part of the header are zeroed out to avoid the downstream problems reported in [forum:d50ec48a293988a5|forum post d50ec48a293988a5].
Do not read past the end of a text buffer looking for a zero terminator, as
that space might not be initialized. If the buffer is owned, just set the
null terminator. This is a better fix for the OSSFuzz-detected
use-of-initialized-value problem.
Multiple optimizations that try to preserve or infer the zero-terminated
property of TEXT values. Avoid unnecessary copying of text values destined
to become function parameters. All changes help improve performance of
doing UPDATEs on large JSON values that are indexed multiple ways.
Experimental framework upon which to build a better JSON parse structure that
supports cached of modified JSON. All of these changes are tentative and
subject to change or removal. Incremental check-in.
stephan [Thu, 20 Jul 2023 09:06:42 +0000 (09:06 +0000)]
Filter the OPFS VFSes out of the sqlite3-node.mjs build. Add another level of subdirectory to the sahpool to later enable transparent support of client-provided files under the VFS's root dir. Rework the awkward sahpool-via-oo1 mapping.
stephan [Wed, 19 Jul 2023 13:31:29 +0000 (13:31 +0000)]
Major restructuring of opfs-sahpool to improve maintainability and hopefully make it easier to reuse these pieces in the upcoming JSPI-based VFS experiment.
Do not use the [/info/609fbb94b8f01d67|viewscan optimization] on a query
that has only a single loop, as the cost adjustments can cause problems
for outer queries. Proposed fix for the performance regression reported by
[forum:/forumpost/64d36440e473516c|forum post 64d36440e473516c].
stephan [Tue, 18 Jul 2023 16:24:51 +0000 (16:24 +0000)]
Major restructuring of the opfs-sahpool bits to better support multiple instances per app (each sandboxed from each other). Eliminate the pesky promise resolution race condition when two such instances are loaded in parallel.
stephan [Mon, 17 Jul 2023 07:13:44 +0000 (07:13 +0000)]
Change wasm build's -DSQLITE_TEMP_STORE=3 to -DSQLITE_TEMP_STORE=2, primarily so that clients can optionally shift temp files from memory to OPFS storage.
stephan [Sun, 16 Jul 2023 16:52:09 +0000 (16:52 +0000)]
Move SAH pool configuration options from the library-level config to a config passed to the VFS install routine. Extend and document the PoolUtil object.
stephan [Sun, 16 Jul 2023 14:07:59 +0000 (14:07 +0000)]
speedtest1.js: only install opfs-sahpool if it's provided via --vfs flag, to avoid locking errors in concurrent speedtest1 tabs with other VFSes. Add opfs-sahpool reserveMinimumCapacity().
stephan [Sun, 16 Jul 2023 12:02:37 +0000 (12:02 +0000)]
During "opfs" VFS init, check for URL param opfs-disable and, if set, do not install the VFS. Added per forum suggestion to provide a way to help rule out misinteraction between the "opfs" and "opfs-sahpool" VFSes.
stephan [Sat, 15 Jul 2023 19:08:58 +0000 (19:08 +0000)]
Correct opfs-sahpool VFS after the pebkac involving the previous speedtest1 runs. Make that VFS explicitly opt-in to avoid certain unfortunate locking situations.
stephan [Sat, 15 Jul 2023 11:23:57 +0000 (11:23 +0000)]
opfs-sahpool VFS now seems to work, in that it runs fine (and blazingly fast) in speedtest1. Add sqlite3.config options for the high-level configurable parts of opfs-sahpool.
stephan [Fri, 14 Jul 2023 23:02:58 +0000 (23:02 +0000)]
Switch opfs-sahpool to use deterministic backing-store file names. Delay VFS registration until after the pool's files are all opened. Fail vfs init if the client's OPFS API has an async FileSystemSyncAccessHandle.close() method (indicating that it's outdated).
stephan [Fri, 14 Jul 2023 21:17:29 +0000 (21:17 +0000)]
Initial sketches for an alternate OPFS VFS which uses a pool of pre-opened SyncAccessHandles to bypass the need for a dedicated I/O worker and the COOP/COEP HTTP response headers. Currently completely non-functional.
Fix an off-by-one error in tests for cells overflowing the end pages. The
error is completely harmless for the default page cache, but might cause
problems for application-defined page caches that pack pages tightly
together.