perf(icons): cache transient missing asset paths#549
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Superseded by consolidated upstream PR #555. |
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
window.electron.statSync.sc-asset://, absolute paths, and extension-relative image filenames.assetsPath, and repeated miss measurement.Why
Repeated missing icon asset paths can synchronously cross renderer-to-main IPC on every render. The short stale window collapses bursty repeated misses without permanently hiding assets that appear after an initial miss.
Compatibility impact
Misses can remain stale for up to 250ms. After that window, the next resolution checks the file system again, so newly available assets become visible. The miss cache is bounded to 4096 entries and clears when full.
Metrics
iterations=10000 statSync=10000 elapsedMs=3.553for repeated missing relative asset resolution.iterations=10000 statSync=1 elapsedMs=5.201for the same repeated missing relative asset resolution.How tested
node scripts/test-icon-asset-cache.mjssrc/renderer/src/raycast-api/icon-runtime-assets.tsx: no errorsnode scripts/test-icon-runtime-file-icon-cache.mjspassed on the integration worker branch; that script is not present onorigin/mainfor this clean PR branchpnpm exec tsc -p tsconfig.renderer.json --noEmitcurrently fails on unrelated upstream renderer type errors outside this changeStack validation
Clean branch from
origin/main; only this scoped fix is included.