Repository navigation
Reuse list rows safely during scrolling - #122
Conversation
[Medium impact] No new blocking issue was established in the current diff. SummaryEnables row reuse in
Reviews (3) · Last reviewed commit: "Keep only the reset a reused row needs" · Reviewed by Greptile |
|
Thanks for this, and for the careful thinking about what a reused row must forget. The list has changed under it since: it's a tree now (#160), so
If the win holds up on the tree with that, it can go in. |
98628c2 to
7c2593c
Compare
|
Thanks. I rebased the original reuse change onto the current tree and moved the tests into For the long-scroll measurement, I used an expanded 2,320-row tree with synthetic PNG/text files and the same 7,680-pixel, two-second scroll on both versions. Across three viewport configurations, median GUI CPU fell from 120–124 ms to 34–40 ms, and the median per-run p95 interval between Qt frame-swap notifications fell from 20.9–21.1 ms to 16.7 ms. This used NVIDIA OpenGL in a private Weston session with a virtual 60 Hz output, eight alternating pairs per configuration. Neither version had an interval over 25 ms; this measures application-side timing, not physical display FPS. There is still a tradeoff: earlier software-rendered runs improved tall-list settling from about 8 to 6.5 ms, but the short mixed list went from 5.3 to 5.8 ms, and the first jump to the end from 8.7 to 11.9 ms. I wouldn't claim a win in every scenario. |
The list made a new row for every file scrolled in and threw away every row scrolled out. Turning on reuseItems gives the rows scrolled out to the files scrolled in instead; scrolling 3,000 files through the list offscreen took 1.5 s of layout before and 0.16 s after. Nearly everything a row shows is bound to its file's roles, so follows the file it's given. What isn't is the picture taken for dragging it: a row given another file under a still pointer stays hovered, so takes no new one, and a drag from there showed the file before. A reused row now drops that picture and, still hovered, takes a new one. The rest of the pilot's guards are dropped: the pooled state gating every handler, the Loader around the tap handler, the arrow's pressed path, the drag generations and holding reuse off during a drag. They cover a mouse button held through a page of scrolling, a double-click split by a jump that moves the cursor, or a scroll during a drag the system holds; and the drag picture's superseded grabs are already ignored by DragPicture since omacom#196. The tests go down to one for the picture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7c2593c to
443dc67
Compare
|
Thanks @k-kostin, the win is real: scrolling 3,000 files through the list offscreen took 1.5 s of layout on main and 0.16 s with Almost everything a row shows is bound to its file's roles, so it follows the file it's given. The one thing that isn't is the drag picture. A row given another file under a still pointer stays hovered, so it never retakes the picture, and dragging from there showed the previous file. The other guards are gone: the |
The list made a new row for every file scrolled into view and destroyed every row scrolled out. It now hands the rows scrolled out to the files scrolled in (
reuseItems), so scrolling a long list costs a fraction of what it did: through 3,000 files, layout took about 0.16 s instead of 1.5 s, and the GUI's CPU during a scroll fell from 120 to 37 ms.What a row shows follows its file on its own, except the picture a drag carries: a row given another file under a pointer that hasn't moved stays hovered and kept the previous file's picture. A reused row now drops it and retakes it when hovered.
🤖 Generated with Claude Code