Repository navigation
Reuse parsed link metadata and batch cold-open query index writes - #2036
Merged
Merged
Conversation
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
A record's parsed frontmatter, membership, path-derived values and body now feed both sides of the link index during metadata derivation. SQLite writes record paths, modification-time sort keys and type memberships in bounded multi-row inserts using the existing 100-bind helper. The same transaction still publishes index coverage. The cold-open regression counts the rows SQLite actually changed and checks that an insert can cover multiple rows.
Chrome OPFS cold open
Seven fresh disk-backed profiles per build and collection size. Each pair reverses the preceding pair's order. Google Chrome 155.0.8059.84 ran on an isolated GCP desk with ext4, the pinned SQLite WASM, the SDK Worker bridge and the real OPFS SAH pool. The synthetic transport serves the same sealed records to both builds. Fixture generation, browser startup and integrity comparisons are outside the timings.
Totals use each run's elapsed sum. With seven samples, nearest-rank p95 is the slowest run. Both fixtures add 50 project notes, then 30 creates and two catalog changes after the snapshot. The 10k median total fell 259.38 ms (2.49%). The small median total rose 0.23 ms and its p95 rose 10.94 ms.
Where the time goes
Columns report independent medians. The last column includes runtime verification, decompression, metadata derivation and projection as well as host driving. OPFS time overlaps SQLite time.
In a separate instrumented baseline run, SQLite spent 1,292 ms stepping explicit commits during install, 355 ms inserting staged records and 353 ms copying records to the confirmed table. During replay the largest step groups were raw frontmatter atom inserts (734 ms), explicit commits (610 ms), trigram body index inserts (602 ms), sort-field inserts (335 ms), and record reads (293 ms). Statement-step times exclude binding and row extraction. The change removes 29,303 replay statements with the same host-call count and the same verified records.
Correctness and build
The verification mode compares SHA-256 over the ordered typed values of all record, resource, link, uniqueness and field rows, the query tables, and the contentless FTS shadow tables. It checks both phases in separate runs. All four comparisons matched, and both raw and field indexes reported ready at the final head.
a4e947b1d1fc78f12013192b916585c8b9a849059139d33247e6591a95fd246abc2a028fa902b1aaf9ba149287882a46c96c540e9d2718c69b2c68f35e8d3a9cac7ff338e5e4e9ccc2dddacb81cc773e1f2db412097cf8124eac8e91d689b7c9256ffec33590e0c615e555628a02ba36f7912c4edb9e82cab5398e3f6eb997d3Regenerating the 10k fixture from the candidate reproduced the benchmark input byte for byte (SHA-256
62fb23a7f8ba6b8d26a53d3ae812581469b8356b5e73fb20673be3efe8bf2b83). A second remapped compile and wasm-opt run reproduced the candidate app binary byte for byte.The remapped baseline rebuilt from
b723b6c4ematched the existing SDK pin. Candidate app WASM SHA-256 isbc0ece9ff1f987117ecb040b074278851284a3d828573a3f76c894683962afc7. Report-only raw / gzip / Brotli sizes changed from 4,135,951 / 1,663,813 / 1,218,197 to 4,140,456 / 1,665,683 / 1,218,694 bytes. The SDK asset pin and size bound were generated and verified together.Native core, replica, file store, native platform and benchmark tests passed (2,531). App-feature tests and wasm32 clippy passed. Native, WASM and all 17 determinism goldens matched. The real SQLite app-WASM smoke, SDK tests (3,093 Vitest and 65 Node tests), and daemon E2E passed. The first full SDK run encountered a Unix socket path-length error and a compiler test timeout. A short checkout passed the entire suite. The repository-selected
pnpm ci:localgates passed.Reproduction
Build optimized app modules in two clean checkouts at the baseline and this branch. On a Linux CI runner with the repo-pinned toolchain, run the following in each checkout, preserving the two output paths.
From the candidate repo root, with
BASEandCANDIDATEset to the absolute module paths and Chrome installed: