Skip to content

Keep unchanged rows between renders on profiles, Starred and threads - #49

Merged
simonhamp merged 1 commit into
mainfrom
perf/row-caches
Oct 21, 2026
Merged

simonhamp merged 1 commit into
mainfrom
perf/row-caches

Conversation

@simonhamp

Copy link
Copy Markdown
Member

The Log keeps the rows it drew last frame (RowCache, from #40), so a render only builds the rows that changed. On Simon's iPhone that took a render at 200 commits from 443 ms to 77 ms. Profiles, Starred and a commit's replies still built every row on every render, so they got slower with each page they loaded, as the Log did.

This gives them the same cache:

  • A profile keeps one per tab (Commits and Replies), passed to feed as the Log does.
  • Starred keeps one, passed to feed.
  • A thread keeps its replies, nested ones included. The commits above the replies are still built every time, because they read things the cache doesn't hash, like whether the replies are open and the reply count.

The cache is safe to use with the same rows on other screens because the row partials only read from the screen what RowInputs already covers: viewer, pasteis, stashes, opened threads, unfolded commits and tombstones. I checked every variable the commit row and reply partials read.

The tab you're not on in a profile now previews three commits instead of five, as the Log's pages beside yours do since #36.

The other Log fixes already reach these screens. The slimmer commit row (#41) is the same partial, the image cache and native dashed borders are app-wide, and Profile already only pulses the skeleton on the tab you're on (#32). Notifications and Remotes draw different rows, so they aren't in this PR.

Tests: RowCacheScreensTest checks each screen builds no rows when nothing changed, only the changed ones when something did, and draws kept rows the same as fresh ones. On a thread that's the last reply of a page and the new page's replies. The full suite passes (1026).

I haven't measured these screens on a phone.

🤖 Generated with Claude Code

The Log keeps the rows it drew last frame (RowCache, from #40), so a
render only builds the rows that changed. Profiles, Starred and a commit's
replies drew every row afresh on every render, so they got slower with
every page they loaded, as the Log did.

A profile keeps a cache per tab, Starred keeps one, and a thread keeps its
replies. The commits above a thread's replies still build every time: they
read what the screen shows of the thread, which the cache doesn't hash.

The tab you're not on in a profile now previews three commits instead of
five, as the Log's pages beside yours do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit a01aedb into main Oct 21, 2026
1 check passed
@simonhamp
simonhamp deleted the perf/row-caches branch October 21, 2026 14:54
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