Skip to content

perf(tracking): skip schema migration on warm Tracker::new#3005

Open
iagogfe wants to merge 1 commit into
rtk-ai:developfrom
iagogfe:perf/tracking-warm-schema-path
Open

perf(tracking): skip schema migration on warm Tracker::new#3005
iagogfe wants to merge 1 commit into
rtk-ai:developfrom
iagogfe:perf/tracking-warm-schema-path

Conversation

@iagogfe

@iagogfe iagogfe commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • When the tracking DB and a versioned schema marker already exist, open SQLite with only busy_timeout instead of re-running CREATE/ALTER/index probes on every CLI call
  • Schema bootstrap still runs fully on cold start / marker miss; bump the marker name when migrations change
  • Small but real warm-path win on every tracked command (measured as part of rtk git status latency after the git-side fix)

Test plan

  • cargo fmt --all --check && cargo clippy --all-targets && cargo test
  • Manual testing: first rtk git status creates .tracking_schema_v3 under the RTK data dir; later processes take the warm open path
  • Perf (local, Linux x86_64, release, hyperfine --shell=none, after the git single-porcelain change):
    • incremental gain on top of dual-git removal: roughly ~11.3 ms → ~10.9 ms mean for rtk git status in A/B remeasures
    • absolute effect is machine- and I/O-dependent (SQLite open dominates less than process spawn); treat as order-of-magnitude tens of percent of the residual RTK overhead, not a headline % claim

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

When the DB and a versioned schema marker already exist, open SQLite with
only busy_timeout instead of re-running CREATE/ALTER/index probes on every
CLI invocation.
@CLAassistant

CLAassistant commented Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tapheret2 tapheret2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: perf(tracking): skip schema migration on warm Tracker::new

Files: src/core/tracking.rs
Size: +19 / -0

Notes

  • Static pass on the patch: no obvious blockers from the diff alone.

Thanks @iagogfe — independent review on the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants