Skip to content

perf(list): virtualize emoji grid rendering#502

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

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

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Added shared fixed-row virtualization helpers for list rows and emoji-grid rows.
  • Switched the emoji-grid render path to render only visible virtual rows plus overscan, with spacer rows preserving scroll height.
  • Kept keyboard movement on the shared 8-column grid constant and mapped selected item indices back to their active virtual row for scroll-into-view.
  • Added a focused regression test for large grouped emoji-grid visible rendering and selected-index row mapping.

Why

The ordinary list path was already virtualized, but the emoji-grid branch rendered every filtered item. Emoji-heavy extensions can produce thousands of cells, making initial render and updates unnecessarily expensive.

Baseline measurement before source edits: a grouped 4,096-item emoji grid rendered 4,096 cells in 26.25 ms.
After measurement: the same list is represented by 514 virtual rows and initially renders 112 cells in 3.12 ms.

Compatibility impact

The public List API and action behavior are unchanged. Section headers, item counts, mouse selection, keyboard selection, context actions, and action execution are preserved. Visual layout uses the same 8-column grid and fixed 96px cells; scroll height is spacer-backed instead of full DOM-backed.

How tested

  • Baseline one-off render measurement before edits: 4,096 rendered cells, 26.25 ms.
  • After one-off render measurement: 112 rendered cells, 3.12 ms.
  • node --test scripts/test-emoji-grid-virtualization.mjs
  • node --test scripts/test-*.mjs (1 live Electron test skipped because Electron is not launchable here)
  • node scripts/check-i18n.mjs (exits 0; reports existing Italian missing keys unrelated to this change)
  • node_modules/.bin/vite build
  • Codex LSP diagnostics on touched runtime files: no errors

Note: pnpm test / pnpm run check:i18n are blocked in this local environment by pnpm 11 pre-run install verification failing on ignored dependency build scripts, so I invoked the underlying package script commands directly.

@JustYannicc JustYannicc changed the title [codex] Virtualize emoji grid list rendering perf(list): virtualize emoji grid rendering Jul 3, 2026
@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