perf(commands): cache script command icon data#568
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
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
Why
Running a script command after the 12s discovery TTL can force a cold rediscovery. File-based script icons were re-read and base64 encoded on every cold discovery, so icon-heavy command sets repeatedly paid the full icon I/O cost even when icon files had not changed.
Compatibility impact
https://icon values still bypass file icon reads.iconDark/iconprecedence are unchanged.How tested
node --test scripts/test-script-command-runner.mjsnode --test 'scripts/test-*.mjs'(236 pass, 1 skipped)./node_modules/.bin/tsc -p tsconfig.main.json --noEmitsrc/main/script-command-runner.ts: no diagnostics foundnode scripts/bench-script-command-discovery.mjsPerformance evidence
Command:
SUPERCMD_BENCH_SCRIPT_COUNT=250 SUPERCMD_BENCH_SCRIPT_BODY_BYTES=0 SUPERCMD_BENCH_SCRIPT_ICON_BYTES=98304 node scripts/bench-script-command-discovery.mjsBefore cache:
readFileSynccalls, 23.4 MiB icon bytesreadFileSynccalls, 23.4 MiB icon bytes, 23.5 MiB total runner bytesreadFileSynccalls, 23.4 MiB icon bytes, 23.5 MiB total runner bytesAfter cache:
readFileSynccalls, 23.4 MiB icon bytesreadFileSynccalls, 0 B icon bytes, 76.1 KiB total runner bytesreadFileSynccalls, 0 B icon bytes, 76.1 KiB total runner bytesDefault emoji benchmark remains healthy:
node scripts/bench-script-command-discovery.mjsreported initial discovery 11.9ms and 0readFileSyncbytes.Stack validation
Started from
codex/perf-consolidated-integration-stack/fork/codex/perf-consolidated-integration-stackat264fb89dc5c867d6c3d77bc4b95e26e235e326ea. Implementation branch iscodex/perf-script-command-icon-cacheat7405505.Replaces
None.