Repository navigation
Engine: keep 12 chats' documents warm again (fixes switch freezes and skeletons in 0.3.8) - #1508
Merged
Merged
Conversation
0.3.8 kept 3, and switching among more chats froze for 50-100 ms or showed a skeleton: a real chat's document is 15-80 MB, and reopening one from its snapshot reads its whole state (45 ms for 15 MB, 280 ms for 80 MB on an M5 Max; the M1 is about 2.5x that). The 3-doc measurement used small mock chats and missed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Reverts the cap from #1500 (3 → 12).
Why: in 0.3.8, opening any chat other than the last three makes the engine reopen its document from SQLite. Real chat documents are big. Wing's recent ones are 4–80 MB, with up to 24M operations. Reopening reads the whole state:
That's the 50–100 ms switch freeze, and the skeleton once it passes 400 ms (sooner on an M1, which is ~2.5× slower). #1500's measurement used small mock chats and missed it.
The real fix is making reopening cheap regardless of how many documents are kept (compacting chat history). This restores 0.3.7's behaviour until then.
Engine
doc_hosttests: 81 passed.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.