[codex] perf: speed up warm snapshot reopen#222
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
word.indexrewrites and align the cleanmain-based branch withAnyTrigramIndexWhy
Warm snapshot startup was still spending seconds rebuilding indexes after loading
codedb.snapshot. This keeps cold indexing effectively flat while making warm CLI and MCP startup dramatically faster.Benchmarks
All numbers below are
ReleaseFastand measured againstv0.2.54on the same machine. The broader benchmark appendix was added post-merge while preparing the0.2.55release.Data Shape: Large Repo CLI (
openclaw)tree5.32s5.29s+0.6%snapshot6.53s6.25s+4.6%tree0.26s6.16s23.7x fastersearch workspace0.24s6.14s25.6x fasterword session0.61s5.99s9.9x fasterData Shape: MCP First Secondary-Project Call (
openclaw)codedb_tree0.076s5.289s69.6x fastercodedb_search0.067s5.278s78.8x fastercodedb_word0.285s5.312s18.6x fasterData Shape: Peak RSS (
openclaw)tree3478.8MB3478.1MBtree192.6MB3314.0MBsearch193.3MB3312.9MBword677.1MB3313.3MBData Shape: Small-Corpus Sanity (
codedb/src)tree0.045s0.040stree0.010s0.030ssearch0.010s0.030sword0.010s0.030sWorkload-Shaping Note
The release also includes WAL profiling and hashed cloud sync from #198 and #199, so production query/open patterns can be aggregated without sending raw query strings or file paths off-machine.
Validation
SDKROOT=$(xcrun --show-sdk-path) zig build testSDKROOT=$(xcrun --show-sdk-path) zig build -Doptimize=ReleaseFastSDKROOT=$(xcrun --show-sdk-path) zig build run -- --helpCloses #220.