Skip to content

test(store): benchmark snapshot persistence and SQLite facade contention - #2334

Merged
DeliciousBuding merged 1 commit into
masterfrom
perf/store-persistence-baseline
Sep 6, 2026
Merged

test(store): benchmark snapshot persistence and SQLite facade contention#2334
DeliciousBuding merged 1 commit into
masterfrom
perf/store-persistence-baseline

Conversation

@DeliciousBuding

@DeliciousBuding DeliciousBuding commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2333
Refs #2256 (remaining FileStore / SQLite measurements, not EventLog #2304).

  • Add FileStore snapshot / indented JSON discard-encoding / actual Sync+rename save / explicit Flush+LastPersistError benchmarks at fixed resident scales.
  • Add real SQLiteStore memory-reader / synchronous durable-writer contention workloads without changing MaxOpenConns, PRAGMAs, timers or production source. Track connection-pool wait deltas and SQL total_changes() outside the timed workload.
  • Bound instrumentation memory with per-reader latency histograms. Quantiles are clock-observed power-of-two bucket upper bounds; zero clock readings are explicit, not a claimed 1 ns operation. Each reader cycle is one GetRun plus one ListRuns for a ten-run thread.
  • Validate complete persisted bytes and restored snapshots outside timing, including content/order/checkpoints; SQLite readback occurs before Close can hide a missing write with another flush.
  • Clarify the existing memory-read / durable-write boundary in the Edge architecture owner document.

Validation

  • Existing store package tests passed on the starting baseline.
  • Full store package tests plus all 21 benchmark cases passed under Linux race instrumentation; final instrumentation/readback changes passed a second all-case race smoke (92.007 s).
  • All 21 final benchmark cases passed on Windows with the pure-Go SQLite driver (CGO_ENABLED=0). These are correctness smoke runs, not performance samples.
  • go vet ./internal/store, staticcheck 2026.1, verify-doc-ssot.py, and diff check passed.
  • Formal non-race Linux measurements passed: 105 samples (21 cases x 5 repetitions), -benchtime=1s -cpu=4 -benchmem. Methodology, all raw samples, medians/ranges and bounded conclusions. All seven required CI gates passed.
  • Retain FileStore and single-connection/WAL configuration. The measured unchanged-checkpoint amplification is tracked separately in fix(store): prune run checkpoints and persist their delta state #2335; this benchmark PR does not include its production fix.

Boundaries

Only generated local temp-store fixtures; no user workspace contents, live database or service changes. Fixed resident entity counts and unthrottled synthetic reader loops are not production request rates. Allocated bytes are process-wide (including concurrent readers), not RSS or writer-only heap. The short workload does not exercise the five-minute background maintenance timer. FileStore's explicit flush workload does not measure its debounce frequency. No performance threshold or new CI job.

Refs #2333. Keep production persistence, pool, and timer semantics unchanged.

Co-authored-by: Codex <codex@vectorcontrol.tech>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: a454893f-c944-42ac-ad89-434533548841

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

Final verification at 3e326515b46ade47692012dbcc45e1e563ce8d7b: all seven live required checks (validate, go-edge, go-hub, windows-go, windows-frontend, backend-required, frontend-required) are present and SUCCESS; merge state CLEAN; no review threads/submitted reviews. Automated review skipping is not treated as review approval.

All 105 formal samples and bounded decisions are saved. Local final all-case Linux race and Windows smoke passed; no new timing gate or production change. The concrete checkpoint follow-up is #2335, kept out of this benchmark PR.

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.

perf(store): measure snapshot persistence and real SQLite facade contention

1 participant