Repository navigation
Batch SQLite record writes during snapshot install - #2021
Merged
Merged
Conversation
callumalpass
force-pushed
the
sprint-w6-snapshot-install-perf
branch
from
November 28, 2026 10:26
670a48b to
5c08f57
Compare
callumalpass
enabled auto-merge
November 28, 2026 10:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1648
SQLite snapshot staging now inserts multiple records, links, and unique values per statement. It clears old lookup keys for the IDs in each chunk and preserves the last write for repeated IDs. The existing transaction and staging swap still determine when the records become visible. The parameter count stays within the app and hosted codecs’ 100-parameter limit.
Snapshot install benchmark
The paired browser measurements below compared the original baseline (
dc4747f59) with the pre-rebase candidate (670a48b56).Seven alternating A/B and B/A pairs per host, with a fresh on-disk Chromium profile for each run. Both builds used the same encrypted fixture, SQLite WASM and OPFS access-handle pool. Each run reached the snapshot head, verified 10,050 confirmed records and closed cleanly. Timing ends before tail replay. The transport served fixture bytes from memory.
The candidate was faster in 7/7 GCP pairs and 4/7 shared-host pairs. GCP paired wall times in milliseconds, in run order (baseline/candidate), were 4856/4524, 4900/4720, 5115/4507, 4790/4453, 4760/4490, 4802/4521 and 4844/4527. Shared-host pairs were 5067/3567, 6273/3914, 5937/10138, 11145/10363, 11406/8566, 4633/10887 and 2606/5320. Shared-host baseline timings ranged from 2.61 to 11.41 s while other jobs were active. These are synthetic install measurements. Production approval-to-first-row latency and parser-specific timing were outside the measurement.
Verification
runtimewithrcargo test --release -p mdbn-bench --test catalog_reindex snapshot_install_at_10k -- --ignored --nocapture. Candidate median was 354 ms across seven installs.Verification after #2015 and #2016
Rebased on
5859fd6b3. The SDK pin now points at runtime source80279ab7b. At head5c08f5765, the remapped WASM passed the real Node SQLite ABI smoke; the Chromium OPFS smoke recovered 1k, 5k and 20k rows. All 389 store/platform tests passed. Seven native release installs each verified 10,050 records and issued 1,410 SQL statements (374 ms median). Pin and method-inventory tests, remote workspace typecheck, all three SDK package checks and the daemon E2E passed.