Skip to content

improve: reduce repeated archive journal validation work - #334

Merged
vincentkoc merged 1 commit into
mainfrom
improve/profile-cli-test-runtime
Nov 20, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
improve/profile-cli-test-runtime

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Archive opens, status reads and native captures repeatedly validate the change journal. Each validation currently prepares 23 separate schema lookups plus a trigger-count query.

User Impact

Journal validation does less SQLite work. Missing or modified objects, unexpected journal triggers and invalid journal state still fail validation and retain the existing repair behavior.

Why This Change Was Made

Read the relevant schema definitions together, then compare the same expected definitions. Keep dynamic source-column inspection and journal-state checks. Add coverage for unexpected triggers and unrelated schema objects, plus a repeatable validator benchmark.

Evidence

  • Independent P0–P3 review: scoped-clean.

  • Five alternating baseline/candidate benchmark pairs: median 313,932 → 168,517 ns/op (46% lower). Allocations: 2,227 → 1,887 per call; bytes: about 172,060 → 161,590.

  • Baseline ns/op: 313932, 400037, 486003, 305510, 312987. Candidate: 163655, 168517, 274936, 189149, 161289.

  • The benchmark measures journal validation on a synthetic temporary archive, not overall CI duration or billing savings.

  • Full local test suite, go vet and module tidiness checks passed.

  • Local validation uses GOWORK=off and CGO_ENABLED=0; hosted Linux race and native macOS checks remain required.

  • Hosted CI run 44733996219 passed on 9b50da54999ecb59618b44aec9df53afc5990be1, including Linux race, native macOS, lint, dependency checks and snapshot builds. Both secret scans, Docker and CodeQL also passed.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@github-actions github-actions Bot added the other label Nov 20, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 20, 2026 12:23
@vincentkoc
vincentkoc merged commit 35493fb into main Nov 20, 2026
21 of 22 checks passed
@vincentkoc
vincentkoc deleted the improve/profile-cli-test-runtime branch November 20, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant