Skip to content

Scrolling a long thread stutters after loading earlier turns (timeline measure pass and per-scroll message re-derivation) #39545

Open

Description

@royalaid

What happened

Scrolling the chat timeline of a long thread (about 3,250 items, 318 turns) stutters on the Windows desktop app. The jank appears after "Load earlier turns" has been used. At the initial page the same thread scrolls smoothly.

Diagnosis

Repro in the web client served by the thread's own server, headless Chromium at 1600x1000, with a scripted 8 s rAF scroll sweep on .messages-timeline-scroll:

State Scroll height DOM nodes p50 p99 Max frame Frames >50 ms
Initial page 3,812 px 2,053 16.7 ms 17.2 ms 67 ms 1
After 8x "Load earlier turns" ~197,000 px ~3,000 16.7 ms 83 ms 200 ms 9

The DOM stays near 3,000 nodes because the list is virtualized, so the cost scales with the amount of loaded history rather than with the DOM.

The CPU trace for the loaded state (8 s of scrolling) shows:

  • 14,980 forced style and layout flushes totalling 1.13 s, plus 640 ms of self time in getBoundingClientRect. All of it comes from the legend-list measure pass (r0 -> W$ in main-*.js), which runs from layout effects during commits and measures every mounted container. In W$, getBoundingClientRect is followed by offsetWidth/offsetHeight and sometimes getComputedStyle.
  • Scroll-time work in useTimelineFollow-*.js that rebuilds message rows: formatMessage takes 218 ms, encode about 116 ms, and lt/Q/yt in session-logic run under Lp/gh/Dh. This re-derivation runs while scrolling, even though the thread is idle and nothing new is arriving.
  • Long Animation Frame attribution names DOMWebSocket.onmessage as the entry point for most long frames (2.45 s), because the runtime picks up work queued behind socket messages. The handler itself takes under 20 ms; the cost is the rendering work above.

Rendering itself is small: about 300 ms in the render phase and 190 ms in paint.

Caveat: headless Chromium rasterizes in software, so absolute frame times are higher than in the desktop app. The layout and JS costs above are CPU-side and carry over.

Steps to reproduce

  1. Open a thread with a few thousand timeline items.
  2. Click "Load earlier turns" until a few hundred thousand px of history is loaded.
  3. Scroll up and down with the wheel or trackpad.

Version

Desktop app 0.1.11-nightly.20261119.4954 (Windows). The thread lives on a linked Linux environment that runs 0.1.11-nightly.20261119.4941, and the headless repro used that server's web client.

Environment

Windows 11 Pro 26300, Ryzen 7 5800X, 128 GB RAM, RTX 3080 Ti, 60 Hz. The machine was idle during the repro (no process above about one core of 16, GPU 3D under 4%).

Evidence

Local scroll traces, LoAF summaries and the CPU trace are available on request.

Workaround

Switch away from the thread and back; it reopens at the first page, which scrolls smoothly.

Related

Agent: Claude Code (Opus 5.5), following the t3 triage playbook.

Activity

  1. added
    via-triage
    on Nov 20, 2026
  2. royalaid commented on Nov 20, 2026

    @royalaid
    Author

    Traces and repro scripts: https://gist.github.com/royalaid/97c7785e1ebf6d11dfb843f83c08f66a

    • scroll-loaded-history.trace.json.gz.b64 is a Chrome performance trace with CPU samples, from the 8 s scroll sweep with about 205,000 px of history loaded (the profiled run in the README). Gists only take text, so it is base64. Decode it with base64 -d scroll-loaded-history.trace.json.gz.b64 > trace.json.gz, then load it in the DevTools Performance panel or ui.perfetto.dev.
    • measure.js is the frame and Long Animation Frame probe behind the numbers in the issue.
    • analyze.py produces the main-thread totals and the callers of getBoundingClientRect and formatMessage.

    The server address, environment id and thread id are replaced with placeholders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions