Skip to content

perf(startup): reduce storage commit amplification - #108

Merged
killswitch-GUI merged 2 commits into
mainfrom
agent/keyless-startup-latency
Aug 8, 2026
Merged

perf(startup): reduce storage commit amplification#108
killswitch-GUI merged 2 commits into
mainfrom
agent/keyless-startup-latency

Conversation

@killswitch-GUI

@killswitch-GUI killswitch-GUI commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • defer Tantivy memory-index initialization until a memory operation needs it
  • skip the redb schema write transaction when all established tables already exist
  • group passive projection checkpoint advances into one adapter transaction
  • preserve the existing optimistic-position and atomic rollback guarantees

Root cause

Plaintext/keyless startup still paid for durability work unrelated to journal encryption. Runtime composition eagerly created the disposable Tantivy index, redb reopened its established schema through an unconditional write transaction, and each non-applicable projection handler committed its checkpoint independently. Slow workspace-backed fsyncs amplified those commits.

Impact

On an isolated same-filesystem clone of the reported 895-event plaintext journal, time to first TUI render improved from 1.476 s to 0.618 s (58%). Journal append durability and hash-chain verification are unchanged.

Validation

  • cargo test -p colossus-memory -p colossus-projection -p colossus-journal-redb -p colossus-runtime --lib
  • ./scripts/check_crate_roots.sh
  • cargo xtask check rust
  • release-mode PTY startup benchmark on the loop-backed workspace filesystem

View with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is enabled.

@killswitch-GUI
killswitch-GUI marked this pull request as ready for review August 8, 2026 03:28

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06178f21c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/colossus-journal-redb/src/journal.rs Outdated
Open every required table with its typed definition inside the read transaction so an incompatible key/value definition is rejected at open time instead of surfacing during a later projection operation.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
@killswitch-GUI killswitch-GUI added the ci:full Run cost-bounded full pre-merge acceptance on the current PR head label Aug 8, 2026 — with ChatGPT Codex Connector
@killswitch-GUI
killswitch-GUI merged commit e3a0504 into main Aug 8, 2026
28 of 29 checks passed
@killswitch-GUI
killswitch-GUI deleted the agent/keyless-startup-latency branch August 8, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run cost-bounded full pre-merge acceptance on the current PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant