perf(search): replace repeated result scans with indexed lookups - #1477
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
PR governance metadata gate is not ready for
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
📝 WalkthroughWalkthrough
ChangesSearch result lookup optimization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change replaces repeated result searches with a memoized ID lookup while preserving selection and ranking behavior. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
현재 head |
확인했습니다. develop 브랜치의 최신 커밋을 반영한 상태에서 SearchLayout 최적화 코드가 유지된 것을 확인했으며, 알려주신 테스트(vitest, eslint, tsc --noEmit)가 통과했다는 점도 확인했습니다. 이전 Strix 실패가 인프라/API 일시적 오류(STRIX_PROVIDER_UNAVAILABLE)였으므로, 잡이 재실행되어 정상 통과하는지 모니터링하겠습니다. |
|
Current-head repair: |
확인했습니다. current-head repair 과정에서 최신 보안 픽스들이 잘 유지되었고, 성능 최적화(SearchLayout O(N) 개선) delta도 그대로 보존된 것을 확인했습니다. 테스트(프론트엔드 테스트, TypeScript, diff 체크)가 모두 성공적으로 완료되었으므로 작업 내용은 완료된 상태로 판단됩니다. 감사합니다. |
Current authority
bolt-optimize-search-layout-477240424295171920@9191ea02b69c08a1b12af36e4a825d5c5869b8e3d3687248894a1427f6614c186a963849ba7ac215frontend/src/components/SearchLayout.tsxandfrontend/src/components/SearchLayout.test.tsxScope
This child replaces the parent lane's memoized
activeResultlinear lookup and the telemetryfindIndexwith oneuseMemo-built id index. Building the index remains O(N) wheneverfilteredResultschanges; subsequent lookups are expected-amortized O(1). No end-to-end or p95 latency improvement is claimed without current-head measurement.The direct-
developparallel SearchLayout writer was already converted into the explicit #1504 → #1477 stack by ordinary two-parent commit61fbe0fff26965c42661eb9d0bf7da7786ed0682; the parent regression remains inherited. The prior branch-local.jules/bolt.mddelta is not part of the effective child scope.Duplicate-id semantic repair
Fresh review revalidated the remaining finding: the indexed implementation used unconditional
map.set(result.id, ...), making duplicate ids last-wins, whereas the replacedfind/findIndexpath was first-wins. That could change both the selected result and the telemetry rank.5966982f93fc72fecbd6e5b51767e5ecfb5ced67adds a component regression with two different search records sharing id303; the contract requires the first record to remain the authoritative detail and its opened event to retaintop_1rank.Map.setbehavior reproduced the defect: the second record survived at index 1.d3687248894a1427f6614c186a963849ba7ac215inserts only when the id is not already present, preserving the former first-match semantics for both active-result selection and rank lookup.The harness is narrow algorithm evidence, not execution of the Vitest component regression, browser/E2E, p95, whole frontend suite, coverage, or hosted GREEN. The Devin duplicate-id thread is resolved on this exact head after the source/test repair was re-read.
Evidence and owner path
Fresh repository-owned pull-request workflow lookup for exact head
d3687248894a1427f6614c186a963849ba7ac215returns 0 runs. This is a known stacked-base control-plane defect, not a reason to copy CI changes into this product branch: canonical Naruon owner PR #1562codex/stacked-pr-workflow-triggers@bc91b36dec70c14e0cde526e2330638f5e0ce352owns Application CI/Bandit/image activation for non-default PR bases and remains Draft behind prerequisite #1531. This PR must consume that protected-integrated owner repair rather than duplicate it or manufacture a no-op requeue commit.Formal review inventory contains no qualifying independent post-last-push
APPROVEDreview. Predecessor checks/reviews do not transfer to this head.Keep Draft until this unchanged exact head has every then-live repository/organization required check terminal-success after the canonical stacked-base fix is integrated, zero valid unresolved current-head findings/threads, and the qualifying independent approval required by live governance. No self-approval, force-push, destructive rebase, dummy/no-op requeue, predecessor-evidence transfer, unsupported p95 claim, or gate weakening.