perf(desktop): prefetch the channel window on sidebar hover intent - #6534
Open
Maxwellimus wants to merge 1 commit into
Open
perf(desktop): prefetch the channel window on sidebar hover intent#6534Maxwellimus wants to merge 1 commit into
Maxwellimus wants to merge 1 commit into
Conversation
Maxwellimus
force-pushed
the
perf/switch-tracing
branch
from
August 22, 2026 16:51
99b0a59 to
03ca3b1
Compare
Maxwellimus
force-pushed
the
perf/sidebar-hover-prefetch
branch
from
August 22, 2026 16:53
6fce904 to
06051a3
Compare
Maxwellimus
force-pushed
the
perf/switch-tracing
branch
from
August 22, 2026 17:19
03ca3b1 to
2a4d128
Compare
A deliberate hover on a sidebar channel row (100ms dwell, so pointer scrubbing never fires) warms that channel's message window, making the subsequent click a cache hit instead of paying the relay fetch on the switch path. The window query options move into a shared factory so the prefetched entry is byte-identical to what the mounted query reads; the prefetch respects the window's staleTime, so hovering a fresh channel never refetches. The mock bridge gains a head-fetch probe (cursorless window reads) so the regression spec can assert dwell-fetches-once / scrub-fetches-never. Signed-off-by: Max Lampert <maxwell@squareup.com>
Maxwellimus
force-pushed
the
perf/sidebar-hover-prefetch
branch
from
August 22, 2026 17:22
06051a3 to
d6aa876
Compare
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.
Based on
perf/switch-tracing— retarget to main after it merges. (Shares the message-window queryFn hunk with the tracing instrumentation.)A deliberate hover on a sidebar channel row (100ms dwell — pointer scrubbing never fires) warms that channel's message window, so the subsequent click paints from cache instead of paying the relay fetch on the switch path. Live traces measured that fetch at 180–310ms per cold channel entry on a real community — this moves it into the hover dwell, ahead of the click.
The window's query options move into a shared factory so the prefetched entry is byte-identical to what the mounted query reads; the prefetch respects the window's staleTime (hovering a fresh channel never refetches) and dedupes with in-flight fetches. Forum channels are excluded, matching the window query's own gating.
The mock bridge gains a head-fetch probe (cursorless window reads) and a regression spec asserts both directions: dwell fetches exactly once before any click; scrubbing across rows fetches nothing.
Recreates #6459. It was approved and squash-merged into its stacked base
perf/switch-tracing, but a force-push of that base (carrying the review-requested P1 fixes for #6455) raced the merge and overwrote the squash commit — so the merged content never survived on the base branch. Same content, same base; still stacked on #6455 and should merge after it.