perf(rendering): avoid unused list virtual rows#559
Closed
JustYannicc wants to merge 71 commits into
Closed
Conversation
(cherry picked from commit fb7405f)
(cherry picked from commit 290a0f5)
(cherry picked from commit 3739cb0)
(cherry picked from commit c78d0b9)
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime-renderers.tsx # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack # Conflicts: # src/renderer/src/CameraExtension.tsx
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack
…ated-integration-stack
… into codex/perf-consolidated-integration-stack
Collaborator
Author
|
Superseded by the consolidated wave-2 UI/runtime PR: #572 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ListComponentnow builds one virtual row layout per filtered item set: normal list rows for list mode, or emoji grid rows for emoji-grid mode. The render branches keep concrete row types through a discriminated layout object, while shared metrics, visible range, scroll-into-view, and item-index mapping continue to consume the selected virtual rows.Why
The previous runtime computed both
buildListVirtualRows(groupedItems)andbuildEmojiGridVirtualRows(groupedItems)on every filtered item change, then discarded one based onshouldUseEmojiGridValue. Emoji-heavy lists paid for a full normal-list row array they never rendered, and normal lists paid for unused emoji-grid rows.Compatibility impact
No intended behavior change. Emoji grid detection, row keys, visible range math, selection mapping, scroll positioning, list/detail mode gating, and both render branches remain functionally unchanged.
How tested
node scripts/test-emoji-grid-virtualization.mjsnode --test scripts/test-list-registry-stable-order.mjs scripts/test-emoji-grid-virtualization.mjsnode --test scripts/test-grid-virtualization.mjs scripts/test-registry-dirty-checks.mjs./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit./node_modules/.bin/vite buildsrc/renderer/src/raycast-api/list-runtime.tsx: no errorsPerformance evidence
Local helper-substep benchmark, 11 samples per case, measuring the old build-both shape against the new conditional shape with the same grouped fixtures:
0.0343 ms/iteration; new emoji path median0.0111 ms/iteration.0.1693 ms/iteration; new emoji path median0.0433 ms/iteration.0.0363 ms/iteration; new normal path median0.0224 ms/iteration.0.1715 ms/iteration; new normal path median0.1172 ms/iteration.The absolute delta is small, but the timing was stable and directly targets the row-construction work removed by this change.
Stack validation
Started from
fork/codex/perf-consolidated-integration-stackfetched at264fb89dc5c867d6c3d77bc4b95e26e235e326ea. Branchcodex/perf-list-conditional-virtual-rowscontains one scoped commit on top:9798e97.Replaces
None.