Skip to content

perf(grid): virtualize grid rendering - #517

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-grid-virtualization
Closed

perf(grid): virtualize grid rendering#517
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-grid-virtualization

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

Summary

  • Virtualize Raycast Grid rendering by flattening grouped sections into positioned virtual rows and rendering only the visible/overscan window.
  • Preserve hidden item/action registration, selection, context actions, keyboard navigation, scrolling, accessories, and root/section layout options (columns, itemSize, aspectRatio, fit, inset).
  • Add a focused Grid performance/regression script for visible-cell counts, selected-item scrolling, and section layout overrides.

Metrics

  • Before runtime edits: node scripts/test-grid-virtualization.mjs reported baseline eager cells=5000, contentResolutions=5000, durationMs=0.589 for a 5,000-item grouped Grid.
  • After virtualization: the same 5,000-item scenario reports virtualized visibleCells=30, renderedRows=7, totalRows=1127, with selection-scroll coverage for item 4242.
  • Final focused run: baseline eager cells=5000, contentResolutions=5000, durationMs=0.342; virtualized visibleCells=30, totalCells=5000, renderedRows=7, totalRows=1127.

Checks

  • node scripts/test-grid-virtualization.mjs passes.
  • npm test passes (Renderer crash recovery (live Electron) skipped because Electron is not launchable here).
  • npm run build:renderer passes.
  • node scripts/check-i18n.mjs completes successfully; it still reports the existing Italian locale gaps for settings.ai.whisper.vocabulary and settings.extensions.appSearchScope.
  • Codex LSP diagnostics are clean for the changed Grid files.
  • ./node_modules/.bin/tsc --noEmit --pretty false 2>&1 | rg "grid-runtime" || true reports no Grid-related typecheck errors. The full renderer typecheck remains red on unrelated existing files.

Risks / Notes

  • The registration tree still mounts hidden Grid.Item elements so extension APIs/actions keep working; the expensive visual cell rendering and icon resolution are limited to visible rows.
  • Live Electron interaction was not available in this environment, so scrolling behavior is covered by the pure layout regression rather than an end-to-end window test.

@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated renderer performance PR #533: #533. Closing this scoped source PR so review stays centralized there.

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