Skip to content

perf: reduce scrolling update overhead - #1111

Open
davidarny wants to merge 3 commits into
mainfrom
codex/fix-scroll-frame-rate
Open

perf: reduce scrolling update overhead#1111
davidarny wants to merge 3 commits into
mainfrom
codex/fix-scroll-frame-rate

Conversation

@davidarny

@davidarny davidarny commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

TL;DR

Reduces avoidable SwiftUI and SVG work while the dashboard scrolls. Keeps reference-backed reorder geometry and cached provider SVG paths, while restoring row-local reorder gestures instead of attaching one simultaneous drag gesture to the whole dashboard.

This PR remains draft. The Instruments results are directional hitch measurements, not an exact FPS claim.

What was happening

  • Reorder geometry preferences replaced a SwiftUI state dictionary as scrolling changed row positions, invalidating the surrounding lists.
  • Provider SVG path data was parsed again while icon shapes rendered.
  • The dashboard-wide simultaneous drag recognizer also participated in ordinary scroll input and gave some of the improvement back.

What this changes

  • Keeps live reorder frames in a reference-backed store so geometry updates do not invalidate the entire list.
  • Parses each provider SVG path and its bounds once, then reuses the cached values.
  • Restores provider and metric reorder gestures to their own header or row.
  • Preserves the existing provider and metric reorder paths in both the dashboard and Customize views.

Heads-up

  • The benchmark-only self-opening hook and scroll driver are not committed to the product branch.
  • Automated runs used a release build, a fresh process, the Animation Hitches template, a 15-second trace, and the same 1,440-event pixel-scroll sequence.
  • The scripted baseline recorded 510.8 ms hitch time/s. The former dashboard-wide gesture version recorded 373.3 and 384.7 ms/s. The product source now committed in this PR is byte-identical to the three-run candidate, which recorded 321.4, 41.4, and 174.2 ms/s.
  • Candidate variance remains high, so these results support the code-path choice but do not establish a stable absolute frame rate.

Tests

  • swift test --filter ReorderGeometryTests — 3 tests passed, 0 failures.
  • swift test — 1,289 tests passed, 3 skipped, 0 failures; the Swift Testing run also passed 3 tests.
  • ./script/build_and_run.sh build — release bundle built successfully (using the repository's prebuilt icon fallback and ad-hoc signing in this environment).
  • Deterministic Instruments matrix completed for baseline, state-only, combined, SVG cache, local coordinates, idle geometry, LazyVStack, scroll hit testing, and the former PR HEAD.

@github-actions github-actions Bot added the docs label Aug 14, 2026
@davidarny
davidarny force-pushed the codex/fix-scroll-frame-rate branch from a9d6c9d to be89eea Compare August 14, 2026 06:22
@robinebers robinebers added the gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) label Aug 14, 2026 — with Cursor
@davidarny
davidarny marked this pull request as ready for review August 15, 2026 04:07
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@davidarny davidarny self-assigned this Aug 15, 2026
@davidarny

Copy link
Copy Markdown
Collaborator Author

@robinebers @validatedev so you can check this build vs main branch. scrolling should be better in terms of FPS.

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

Labels

docs gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants