Skip to content

perf(desktop): stop background streams from rebuilding idle sessions - #1

Merged
kitlangton merged 1 commit into
mainfrom
idle-frame-cost
Nov 8, 2026
Merged

kitlangton merged 1 commit into
mainfrom
idle-frame-cost

Conversation

@kitlangton

@kitlangton kitlangton commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Side tabs no longer rebuild every project’s worktree list to find one tab’s avatar. Background text can update its session without rebuilding the page you are reading. Visible busy indicators keep their cadence.

❌ Before: An incoming network delivery requested a window redraw. Updating the timestamp of an unrelated session could also rebuild the current page. The sidebar then materialized and deduplicated worktree lists for each tab.

✅ After: Coalesce deliveries into a quiet poll that Rune can skip presenting. Keep timestamps current, but invalidate only views that use them. Check membership directly, starting with the session’s project.

- delivery → redraw; tab → build candidate worktree lists
+ delivery → poll → present if changed; tab → test membership

Release fixture: 10 side tabs, four busy sessions, 24 projects, 40 worktrees each and a 1,600-message timeline. Same Mac; 32 warmups and 288 timed updates, before the rebase.

Update Before After
p50 3.03 ms 1.17 ms
p90 3.49 ms 1.47 ms

The new headless regression checks for no scheduled frames at rest, no rebuilds while the radar ticks, and no commits on 180 background events. It does not measure native presentations on a user’s machine.

👀 Read: launch::inbox_waker changes only network deliveries. Image completions still request a normal redraw.

Checks run
  • Release: cargo test --release --locked -p opencode-desktop perf::sidebar_tests -- --include-ignored --nocapture --test-threads=1: passed before rebase.
  • cargo test --locked -p opencode-desktop: new regression passed on rebased head; full suite 632 passed, 64 failed, 26 ignored. All 64 failures also reproduced on the unmodified base (15 in the initial run, 49 in an exact-test follow-up). The full-suite gate is not green.
  • scripts/file-size.sh: passed. scripts/folder-shape.sh: same two errors on base and head.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into main. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode-rune/desktop/dev/macos-arm64-dmg.

@kitlangton
kitlangton marked this pull request as ready for review November 8, 2026 02:09
@kitlangton
kitlangton merged commit f293784 into main Nov 8, 2026
2 checks passed

This branch was previously deployed

1 inactive deployment
release — 838128f7 Deployed Nov 8, 2026 by kitlangton via sign-macos #10
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