Skip to content

perf: clean-close fast path (skip full LPG serialize) - #3

Open
jarmen423 wants to merge 3 commits into
agent/txn-session-batch-20260726from
perf/close-fast-path
Open

perf: clean-close fast path (skip full LPG serialize)#3
jarmen423 wants to merge 3 commits into
agent/txn-session-batch-20260726from
perf/close-fast-path

Conversation

@jarmen423

Copy link
Copy Markdown

Summary

Clean no-write GrafeoDB::close() no longer forces FlushReason::Explicit full LPG serialize (root cause of ~137.6s sidecar close CPU).

Uses dirty-only Checkpoint when WAL is enabled, record_count()==0, and no recovery/index DDL flush flag.

Separate from diagnostics PR #2 (diagnostics/close-forensics).

Head: 166e3c200ba145fc637bbc6b197f318b0c6ba944
Base: agent/txn-session-batch-20260726 (9781320f)

Correctness

  • clean_close_does_not_advance_checkpoint_iteration
  • dirty_close_persists_and_advances_iteration
  • wal_recovery_forces_checkpoint_on_close

Test plan

  • Review docs/TRACK_C_CLOSE_FAST_PATH.md
  • Staging sidecar clean open→close wall when MemAvailable allows

Made with Cursor

Close previously always used FlushReason::Explicit, which re-serializes
every section even when ephemeral wrappers are clean. Prefer dirty-only
Checkpoint when the session has no WAL records and no forced flush,
preserving Explicit for mutations, WAL-off, and recovery.
Ignored GRAFEO_CLOSE_BENCH_PATH harness under /data/tmp only; document
before/after am-personal clean-close wall (~26s → ~0.13s).
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.

1 participant