Repository navigation
perf(ui): find in a long transcript opens at once instead of drawing the whole conversation, and holds a third less memory on a phone - #804
Merged
Michael McQuade (giraffesyo) merged 1 commit intoNov 17, 2026
Conversation
…the whole conversation, and holds a third less memory on a phone Find drew every message of the conversation while it was open, through the message list's `whole`, so it could search all of it. On a long agent session that froze the page, and on a phone it took more memory than the tab had. Find now searches the whole conversation without drawing it: - The list reads the messages it doesn't draw a few at a time, out of sight and between frames, as they would show, and keeps their text. It reads only while find is open, and keeps the text of a turn it lets go of as the reader left it. - Find counts the matches in the text it has read along with those in the turns drawn. Until it has read them all, the count says more may come. - Stepping to a match in a turn the list doesn't draw draws that turn and shows the match, as stepping to one on screen does. - A match no longer runs from one message into the next. `whole` still draws every message for a host that asks for it; `SessionView` no longer does.
Michael McQuade (giraffesyo)
deleted the
perf/find-without-drawing-all
branch
November 17, 2026 17:37
This was referenced Nov 17, 2026
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
Find drew every message of the conversation while it was open, through the message list's
whole, so it could search all of it. In a long agent session that froze the page for most of a second on desktop and two and a half seconds on a phone, and on a phone it took the page from about 370 MB to 820–860 MB.Find now searches the whole conversation without drawing it:
27 of 29+.The long agent session story, searching for a phrase every shard's reply holds, stepping back through the matches, then searching for the first turn. Before on the left draws the whole conversation as find opens; after on the right draws a few turns around the match. The counter shows the elements each transcript holds:
find.mp4
A match in the third of forty turns, at desktop and phone width:
The count while the list is still reading, on a page slowed so it shows:
wholestill draws every message for a host that asks for it;SessionViewno longer does. While find reads, a host's own tool renderers draw once for each turn, as they do when the reader scrolls past it.Testing
SessionView.find.test.tsx: finds in a turn the list doesn't draw and draws it to show the match, counts the matches in turns it doesn't draw without drawing them all, says more may come while it reads, and steps from the last turn to a match in the first.ChatMessageList.window.test.tsx:revealdraws a message's turn with the message at the top, the list reads the turns it doesn't draw a few at a time and only while asked, keeps the text of a turn it lets go of, and forgets what it read when expand-all changes. Each fails with the code it covers broken (14 cases).Measured in a host app's production build against an agent session of 100 turns with 4,000 tool calls and 800 edits, before and after built from source the same way, three rounds each, alternating:
Both found the same matches and showed the same one. The page opens at 358–381 MB in both; on a phone the after build keeps about 170 MB more once it has read every turn, which Chromium's heap after collection doesn't show (29 to 32 MB), so it is memory WebKit hasn't returned rather than anything kept.
Checklist
make checkpasses: its TypeScript half (lint-js,test-js,verify-build); no Go changedproblem/messages/(none)