perf(commands): reduce command and file refresh overhead#573
perf(commands): reduce command and file refresh overhead#573JustYannicc wants to merge 7 commits into
Conversation
Review — perf(commands): reduce command and file refresh overheadFocused, well-tested perf refactor of three independent hot paths (command-metadata cache, file-search delete tombstones, script-command icon caching). I traced each against upstream Strengths
Concerns / potential bugs
Suggestions (optional)
Overlaps conceptually with #620 (command search validation) but touches different code (discovery/refresh vs. search), so no duplication. Types are sound ( 🟡 Approve with minor comments 🤖 Automated review by Claude Code (Opus 4.8). |
|
Addressed the maintainer follow-up from the top-level review. Changes:
Notes:
Verification:
|
What changed
Why
These hot paths can run during filesystem watcher bursts, script command rediscovery, and @raycast/api metadata updates. The consolidated changes reduce repeated scans and rediscovery while preserving command ordering and existing search/script semantics.
Compatibility impact
How tested
node --test scripts/test-file-search-delete-batch.mjsnode --test scripts/test-script-command-runner.mjsnode --test scripts/test-command-metadata-cache.mjsSUPERCMD_BENCH_SCRIPT_ICON_BYTES=4096 node scripts/bench-script-command-discovery.mjsnode scripts/benchmark-file-search-delete-batch.mjstsc -p tsconfig.main.json --noEmit --pretty falsesrc/main/file-search-index.ts,src/main/script-command-runner.ts,src/main/commands.ts, andsrc/main/main.tsgit diff --checkPerformance evidence
Stack validation
origin/mainat9bdd3d2.codex/consolidate-command-file-wave2.Replaces