Repository navigation
perf: reduce DB::view capture cost and COW reclamation debt - #76
Open
feichai0017 wants to merge 2 commits into
Open
feichai0017 wants to merge 2 commits into
feichai0017 wants to merge 2 commits into
Conversation
Batch frozen root capture and persist named-tree epoch summaries at checkpoint instead of manufacturing dirty roots on reads. Retire detached versions against their actual visibility interval and prune unpersisted images only outside older checkpoint dependency frontiers. Preserve dirty WAL debt, escaped reader leases and GC pins. Cover epoch exhaustion, foreign-tree COW, checkpoint graph protection and synced-WAL recovery without a final checkpoint.
Run the same multi-family handler against Holt and SQLite with balanced frozen-binary A/B order, full domain fingerprints and reopen verification. Keep durability and checkpoint differences explicit. Record bounded macOS results, sync replication and raw-bundle hashes. Keep large raw samples and unredacted desktop environment logs local.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
What changed
Reduce the cost of consistent multi-tree reads and prevent short-lived COW versions from becoming unnecessary checkpoint/store debt, without changing the public API, on-disk format, cross-tree consistency, escaped-reader lifetime or WAL/fsync acknowledgement boundary.
Test plan
Local checks on the branch rebased onto main
36fb295:cargo fmt --all --check, plus formatting of the independent benchmark crate.cargo clippy --offline --locked --workspace --all-targets --all-features -- -D warnings.RUSTDOCFLAGS="-D warnings" cargo doc --offline --locked --workspace --all-features --no-deps.cargo check --offline --locked --manifest-path benches/agent_workspace/Cargo.toml --target-dir targetand both runner CLI checks.cargo test --locked --workspace --all-features --lib --tests --examples --quietrerun passed, including all 493 library unit tests, integration/example targets and workspace binding tests. Existing opt-in ignored tests remain ignored.The measured implementation previously passed the complete lib/integration/example suite, a 100k-operation DB oracle soak, and a 30-second / 95-round SIGKILL/reopen smoke for acknowledged cross-tree writes. Additional background correctness runs (100k metadata, a different-seed 40k metadata, and 12k content) reopened successfully without background errors. These are smoke tests, not power-cut or long-running qualification. Linux/io_uring, fuzz, coverage and MSRV remain CI gates.
Performance evidence
Full report and caveats. Apple M3 Pro; the identical handler/configuration in 132 balanced baseline/patched/SQLite processes plus 12 sync follow-ups. All 144 passed complete ordered-domain fingerprints and reopen checks.
Single-client metadata view+reads stage decreased about 18% (not a pure-capture microbenchmark). Sync workloads were broadly unchanged: attached-metadata initially measured -3.0%, then -0.24% on balanced replication, with overlapping process ranges; this is not a universal zero-regression claim.
Numbers were measured against
f080dafplus the recorded patch, before rebasing over main's manifest dual-writer fix and dependency update. They are not a fresh full performance matrix of the rebased head. SQLite OFF is diagnostic, not crash-equivalent; native background checkpoint cadence is not matched. Burst gains are not steady-state claims. Four-client metadata remains slower than SQLite OFF; root capture still copies one 512 KiB frame per unique tree. A longer correctness-only run retained 76 reclaimable GUIDs after one bounded cleanup, so universal backlog elimination is not claimed.Only aggregate results, methods and bundle hashes are committed. Large raw samples, exact-source bundles and unredacted desktop process snapshots are retained locally, not published.
Related
Follow-up to the agent-workspace comparison on Holt 0.9.2. No version bump, release, NoKV OCC changes, or business history/outbox retention changes. Two logical commits: engine/tests/design, then reproducible benchmark/evidence.