perf(root-search): optimize command scoring#506
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
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
scripts/test-root-search-perf.mjs, a focused synthetic root-search perf harness that compares the legacy two-pass command candidate output against the optimized path.rankCommandsinstead of rescanning the same command fields inuseLauncherCommandModel.filterCommandslist for normal non-empty root searches, where display already comes from assembled ranked root sections. Calculator fallback queries still compute the legacy list.Why
scoreRootSearchCandidate.Compatibility impact
How tested
node scripts/test-root-search-ranking.mjsnode scripts/test-root-search-perf.mjsnode --test 'scripts/test-*.mjs'node scripts/check-i18n.mjs./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit(fails on existing repo type errors outside this change, includingApp.tsx,CameraExtension.tsx,LiquidGlassSurface.tsx, browser profile typing inuseLauncherCommandModel.ts, raycast runtime files, and quicklink icon typing).Perf numbers from
node scripts/test-root-search-perf.mjsover 6,000 synthetic commands, 8 queries, 6 iterations:3570.81ms; optimized estimate before score reuse2190.89ms.3872.38ms; optimized command scoring path median1753.83ms; speedup2.21x.node --testrun: legacy comparator median3747.75ms; optimized command scoring path median1661.77ms; speedup2.26x.