Skip to content

perf(renderer): reduce virtualized selection scroll churn - #604

Closed
JustYannicc wants to merge 121 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-renderer-virtual-scroll-churn-20260705
Closed

perf(renderer): reduce virtualized selection scroll churn#604
JustYannicc wants to merge 121 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-renderer-virtual-scroll-churn-20260705

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Changed Raycast Grid virtual selection correction from smooth scrolling to instant behavior: 'auto'.
  • Changed LauncherCommandList virtual selected-row correction from smooth scrolling to instant behavior: 'auto'.
  • Added scripts/test-virtual-selection-scroll-behavior.mjs to assert the selected virtual scroll paths do not reintroduce smooth scroll animations.

Why

Held arrow navigation can update selection faster than smooth scrolling animations complete. The List runtime already uses instant scroll for this reason; matching that behavior in Grid and Launcher avoids queued browser animations and the resulting retained animation/jank risk while preserving the same selected-item viewport math.

Compatibility impact

Selection semantics, virtual window inclusion, refs, focus handling, accessibility attributes, and scroll target math are unchanged. The only user-visible difference is that keyboard-driven selected-item auto-scroll correction is instant instead of animated in these virtualized surfaces.

How tested

  • node --test scripts/test-virtual-selection-scroll-behavior.mjs scripts/test-grid-virtualization.mjs scripts/test-launcher-command-list-windowing.mjs
  • node scripts/run-node-tests.mjs --exclude-perf
  • ./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit --pretty false
  • node scripts/check-package-manager-parity.mjs
  • Codex LSP diagnostics on src/renderer/src/raycast-api/grid-runtime.tsx: no diagnostics found
  • Codex LSP diagnostics on src/renderer/src/components/LauncherCommandList.tsx: no diagnostics found
  • Note: npm run typecheck:renderer could not run because npm is intentionally disabled on this Mac; the equivalent renderer tsc command passed directly.

Performance evidence

Audit baseline on codex/perf-wave4-integrated-stack-20260705 at ac90ce403aeddab98d0a1b245afce268c48b8bfd:

  • node scripts/measure-raycast-grid-render-churn.mjs --iterations=5 --warmups=1 --selection-steps=800 --json: selectionScroll.scrollUpdates=743, median 0.400875ms, p95 2.28325ms; selectionRenderChurn.cellRenderCount=1600, median 354.815833ms, p95 621.91025ms.
  • node scripts/measure-launcher-command-list-render.mjs --iterations=5 --json: totalRows=122, totalMedianMs=3.494833ms.

Local before on this branch before the patch:

  • Grid: selectionScroll.scrollUpdates=743, median 0.425208ms, p95 2.916209ms; selectionRenderChurn.cellRenderCount=1600, median 191.135208ms, p95 219.773709ms.
  • Launcher: totalRows=122, totalMedianMs=4.451667ms.

Local after this patch:

  • Grid: selectionScroll.scrollUpdates=743, median 0.392667ms, p95 2.594583ms; selectionRenderChurn.cellRenderCount=1600, median 178.294125ms, p95 194.187708ms.
  • Launcher: totalRows=122, totalMedianMs=3.712958ms.

Structural evidence: both virtualized selected-scroll paths now use behavior: 'auto', and scripts/test-virtual-selection-scroll-behavior.mjs fails if either path switches back to behavior: 'smooth'.

Stack validation

Started from codex/perf-wave4-integrated-stack-20260705 at ac90ce403aeddab98d0a1b245afce268c48b8bfd; verified git rev-parse HEAD returned that exact SHA before creating codex/perf-renderer-virtual-scroll-churn-20260705.

Replaces

Wave5 performance implementation thread. Replaces no prior PR.

(cherry picked from commit 83c2a89)
(cherry picked from commit 0a7560b)
# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…launcher surfaces

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…IO stalls

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
…resh overhead

# Conflicts:
#	scripts/bench-script-command-discovery.mjs
#	scripts/benchmark-file-search-delete-batch.mjs
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-file-search-delete-batch.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/file-search-index.ts
#	src/main/main.ts
…hurn

# Conflicts:
#	scripts/lib/script-command-runner-harness.mjs
#	scripts/lib/ts-import.mjs
#	scripts/test-extension-lifecycle-sandbox.mjs
#	scripts/test-script-command-runner.mjs
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
… hot paths

# Conflicts:
#	scripts/test-use-frecency-sorting.mjs
#	src/renderer/src/raycast-api/form-runtime.tsx
#	src/renderer/src/raycast-api/grid-runtime-hooks.ts
#	src/renderer/src/raycast-api/grid-runtime-items.tsx
#	src/renderer/src/raycast-api/hooks/use-frecency-sorting.ts
# Conflicts:
#	.github/workflows/project-checks.yml
#	package.json
#	scripts/file-search-perf-harness.mjs
#	scripts/test-browser-search-performance.mjs
#	scripts/test-file-search-perf-harness.mjs
#	scripts/test-root-search-perf.mjs
#	src/renderer/src/CameraExtension.tsx
#	src/renderer/src/hooks/useBrowserSearch.ts
#	src/renderer/src/raycast-api/list-runtime.tsx
…cle and media fixes

# Conflicts:
#	scripts/lib/ts-import.mjs
#	scripts/measure-extension-bundle-cache.mjs
#	src/main/commands.ts
#	src/main/extension-runner.ts
#	src/main/main.ts
#	src/renderer/src/ExtensionView.tsx
#	src/renderer/src/raycast-api/grid-runtime-hooks.ts
#	src/renderer/src/raycast-api/list-runtime-hooks.ts
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated renderer/Raycast wave5 PR #621: #621

@JustYannicc JustYannicc closed this Jul 5, 2026
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