⚡ Bolt: [O(1) early-exit for fullName and path fuzzy matching]#526
⚡ Bolt: [O(1) early-exit for fullName and path fuzzy matching]#526AhmmedSamier wants to merge 1 commit into
Conversation
Added `itemFullNameBitflags` and `itemPathBitflags` parallel arrays to `SearchEngine` to perform an O(1) early-exit before expensive fuzzy sorting in `tryFuzzyMatchFullName` and `tryFuzzyMatchPath`. This skips non-matching evaluations for items that pass the aggregate bitmask but fail the specific property's character requirements. Co-authored-by: AhmmedSamier <17784876+AhmmedSamier@users.noreply.github.com>
|
👋 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough
ChangesBolt: per-property bitflag O(1) early-exit for fuzzy matching
Sequence Diagram(s)sequenceDiagram
participant SearchLoop
participant tryFuzzyMatchFullName
participant tryFuzzyMatchPath
participant Fuzzysort
SearchLoop->>tryFuzzyMatchFullName: item index + queryBitflags
tryFuzzyMatchFullName->>tryFuzzyMatchFullName: itemFullNameBitflags[i] & queryBitflags check
alt gate fails
tryFuzzyMatchFullName-->>SearchLoop: -Infinity
else gate passes
tryFuzzyMatchFullName->>Fuzzysort: fuzzy match on fullName
Fuzzysort-->>SearchLoop: score
end
SearchLoop->>tryFuzzyMatchPath: item index + queryBitflags
tryFuzzyMatchPath->>tryFuzzyMatchPath: itemPathBitflags[i] & queryBitflags check
alt gate fails
tryFuzzyMatchPath-->>SearchLoop: -Infinity
else gate passes
tryFuzzyMatchPath->>Fuzzysort: fuzzy match on path
Fuzzysort-->>SearchLoop: score
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Closing as duplicate of #533 which implements the same bitflag early-exit optimization. |
Understood. Acknowledging that this work is a duplicate and stopping work on this task. |
💡 What: Added parallel bitflag arrays (
itemFullNameBitflagsanditemPathBitflags) to theSearchEnginestruct-of-arrays architecture to perform fast O(1) character filtering before executing expensiveFuzzysort.single()evaluations on thefullNameandpathproperties.🎯 Why: An item may pass the aggregate
itemBitflagscheck (because the characters exist somewhere within the name, fullName, or path), but then subsequently fail thetryFuzzyMatchFullNameortryFuzzyMatchPathfallback evaluations. Adding property-specific bitflags avoids calling intoFuzzysortentirely when the specific string is guaranteed not to contain the required query characters.📊 Impact: Reduces expensive fuzzy evaluations for fallback properties during deep search queries, skipping unviable paths immediately.
🔬 Measurement: Verified using
language-serverbenchmarks and test suites, preventing significant fuzzy match overhead in worst-case text searches.PR created automatically by Jules for task 17088394927139376535 started by @AhmmedSamier
Summary by CodeRabbit