perf(search): reduce indexing and ranking overhead#535
Open
JustYannicc wants to merge 16 commits into
Open
Conversation
This was referenced Jul 3, 2026
This was referenced Jul 3, 2026
Contributor
|
Reviewed the full diff (mostly test/perf harnesses; ~750 lines of real source changes across 8 files). Focused on ranking/relevance parity, index correctness, and the internal>browser precedence rule. Traced the actual match predicates and downstream assembly rather than trusting the harnesses alone. Strengths
Concerns / potential bugs
Suggestions (optional)
🟡 Approve with minor comments — the perf work preserves ranking/ordering and the internal>browser precedence rule; the one real divergence is masked by the promotion floor, and the script-runner edges are low-risk. Worth restoring the explicit 🤖 Automated review by Claude Code (Opus 4.8). |
Collaborator
Author
|
Follow-up for the review feedback is pushed in Addressed:
Verification:
|
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
Consolidates the search, file indexing, launcher file-candidate assembly, and command discovery performance work into one upstream PR.
The combined change removes root ranking diagnostics, memoizes frecency defaults, reuses and precompiles root command scoring data, indexes browser search hot paths, avoids full script reads for Raycast headers, keeps healthy file-index intervals incremental, speeds up file delete tombstoning and path-like queries, maps launcher file result commands by path, and adds focused performance/correctness harnesses for those paths.
Why
These changes reduce repeated ranking, indexing, lookup, and discovery work on launcher hot paths. Keystrokes should avoid unnecessary full browser scans, repeated command rescoring, repeated root command field normalization/tokenization, O(n^2) launcher file-result command lookups, large path scans, interval rebuilds when the watcher is healthy, and full reads of large script command files during discovery.
Compatibility impact
Runtime behavior is intended to stay compatible. Existing scoring and ordering paths remain the source of truth after indexed candidate selection, root command scoring keeps alias exact sorting, always-on-top handling, title tie-breaks, and second-pass match metadata, file search keeps full fallbacks for query shapes that cannot be represented safely by the index, script execution keeps shebang/bash behavior, and launcher file result command matching keeps strict path matching, result order, command data, missing-command fallback behavior, and first-command-wins duplicate path semantics. No user-facing strings or i18n keys changed. The new scripts are test/performance harnesses plus a
perf:file-searchpackage script.How tested
src/renderer/src/hooks/useLauncherCommandModel.tsorsrc/renderer/src/utils/launcher-file-candidates.tsafter folding perf(files): map launcher file result commands by path #552.git diff --check origin/main...HEAD: passed.node --test scripts/test-launcher-file-result-command-map.mjs: passed.node scripts/test-root-search-ranking.mjs: passed.node scripts/test-root-search-perf.mjs: passed.node --test 'scripts/test-*.mjs': passed, 45 passing tests and 1 expected Electron-launch skip.pnpm exec tsc -p tsconfig.renderer.json --noEmit --pretty false: attempted after dependencies were generated, but the local pnpm wrapper re-entered install policy and failed on ignored build scripts../node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit --pretty false: still fails on existing repo-wide renderer type debt fromorigin/main, including existing errors inApp.tsx,CameraExtension.tsx,LiquidGlassSurface.tsx, browser profile typing inuseLauncherCommandModel.ts,useLauncherKeyboardControls.ts, and several Raycast runtime/settings/quicklink files.Performance evidence
.findmedian 18.121 ms vs path-map median 0.024 ms, with equal checksum 11445000.node --test scripts/test-launcher-file-result-command-map.mjson this branch reported path-map median 28.471 ms vs find-backed median 48.703 ms on 3,000 results, 1.71x speedup, with equal checksum 99347250.origin/main10,760.35 ms vs this branch 14.41 ms on 68,162 entries / 4,041 delete paths.origin/maindiscovery 85.2 ms and 40.0 MiB read vs this branch 10.0 ms and 1.3 MiB read; cached execution shebang lookup 5.2 ms / 1.0 MiB vs 2.8 ms / 0 B.origin/mainhealthy interval rebuilds=3 and watcher-error recovery rebuilds=0; this branch healthy interval rebuilds=0 and watcher-error recovery rebuilds=1.origin/main11,429.38 ms total / 31.748 ms per query vs this branch 17.21 ms total / 0.048 ms per query on 61,201 entries / 360 queries.Stack validation
#552's clean commit
5ce121ewas folded into #535 by cherry-pick ascb0f2ea2e5c52678a819870d3e7f73e00ff36e7boncodex/consolidate-search-indexing. The branch was pushed toJustYannicc:codex/consolidate-search-indexing, and #535 remains targeted atSuperCmdLabs/SuperCmd:main. Generated rootpnpm-lock.yamlandpnpm-workspace.yamlfiles were removed before push and are not tracked.Standalone renderer typecheck still fails on existing repo-wide renderer type debt from
origin/main; this PR keeps that validation cleanup separate. Touched-file LSP diagnostics for the #552 fold-in are clean.Replaces
perf(search): remove root ranking diagnosticsperf(files): optimize file search delete batchesperf(frecency): memoize sorting defaultsperf(files): avoid interval file-index rebuildsperf(script-command): avoid full script reads for headersperf(root-search): optimize command scoringperf(file-search): speed up path-like queriestest(file-search): add performance harnessperf(browser-search): index hot query pathperf(files): map launcher file result commands by path(folded in ascb0f2eafrom clean commit5ce121e; current integrated harness reports path-map median 28.471 ms vs find-backed median 48.703 ms, 1.71x speedup, with exact checksum parity)perf(root-search): precompile command scoring fields(folded in asd1589f4; current root scoring harness reports indexed median 110.06 ms vs legacy 2340.07 ms, 21.26x speedup, with exact result-signature assertions passing)