Skip to content

⚡ Bolt: [Fast Bitflag Filtering in Burst Search]#444

Merged
AhmmedSamier merged 3 commits into
masterfrom
bolt-fast-bitflag-burst-search-18266909100182459620
May 22, 2026
Merged

⚡ Bolt: [Fast Bitflag Filtering in Burst Search]#444
AhmmedSamier merged 3 commits into
masterfrom
bolt-fast-bitflag-burst-search-18266909100182459620

Conversation

@AhmmedSamier

@AhmmedSamier AhmmedSamier commented May 16, 2026

Copy link
Copy Markdown
Owner

💡 What
Introduces queryBitflags calculation in burstSearch and passes it to findBurstMatches, adding a rapid O(1) subset bitwise check ((this.itemBitflags[i] & queryBitflags) !== queryBitflags) to skip items before any string indexing occurs.

🎯 Why
burstSearch was doing redundant string evaluations indexOf() on every candidate item during its fallback searches, despite the codebase already having a well-defined character bitflag heuristic. This acts as a highly optimized character-level Bloom filter.

📊 Impact
Typical partial-match worst case ("no match") speeds improved massively from ~29ms down to ~1.1ms (~96% speedup). Typical partial-match typical case ("S") speeds improved from ~1.8ms down to ~0.6ms (~66% speedup).

🔬 Measurement
Verified via cd language-server && bun run benchmarks/search_burst.bench.ts which demonstrates the reduction in max execution time and latency across 50,000 items.


PR created automatically by Jules for task 18266909100182459620 started by @AhmmedSamier

Summary by CodeRabbit

  • Refactor
    • Improved search performance through burst search query matching optimization, reducing unnecessary computations during search operations.

Review Change Stack

Applies an O(1) bitmask check to `findBurstMatches` to filter out irrelevant items early, avoiding expensive string matching on items that don't even have the required characters.

Co-authored-by: AhmmedSamier <17784876+AhmmedSamier@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@AhmmedSamier has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 35 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dde96e26-6d11-420a-bda4-b332bfc0ffe0

📥 Commits

Reviewing files that changed from the base of the PR and between f31b5db and 7782ecf.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • language-server/src/core/search-engine.ts
📝 Walkthrough

Walkthrough

This PR optimizes the burst search matching path by introducing bitflag-based item prefiltering. The query bitflags are computed once, threaded into findBurstMatches, and used to skip items before expensive string and scoring operations in the hot loop.

Changes

Burst Search Bitflag Prefiltering

Layer / File(s) Summary
Bitflag prefilter integration and optimization
language-server/src/core/search-engine.ts, .jules/bolt.md
burstSearch computes queryBitflags from queryLower and passes it to findBurstMatches. The function signature is updated to accept the new parameter. Inside the item processing loop, a bitwise-AND check on itemBitflags & queryBitflags provides an early-exit gate to skip items before string evaluation. The optimization is documented in the changelog.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AhmmedSamier/DeepLens#256: Threads bitflag-based gating into burst search scoring fast path using the same bitflag short-circuiting pattern.
  • AhmmedSamier/DeepLens#253: Also modifies findBurstMatches in language-server/src/core/search-engine.ts to use query bitflags for early item-pruning.
  • AhmmedSamier/DeepLens#418: Adds related prechecks in the burstSearch hot path to reduce per-item work via different optimization strategies.

Suggested labels

codex

Poem

🐰 A rabbit hops through search results fast,
With bitflags bright, no time to waste,
Skip the slow paths, let filters sing,
One precomputed mask—optimization's wing! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the core optimization: bitflag filtering in burst search, which aligns with the main change of precomputing queryBitflags and using them for fast pre-filtering in findBurstMatches.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-fast-bitflag-burst-search-18266909100182459620

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.jules/bolt.md:
- Line 38: Update the changelog header date in .jules/bolt.md by replacing
"2024-06-11" in the section title "## 2024-06-11 - [Fast Bitflag Filtering in
Burst Search]" with the correct PR creation date (e.g., "2026-05-16" or another
appropriate May 2026 date) so the header reads "## 2026-05-16 - [Fast Bitflag
Filtering in Burst Search]".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7b3476f-ded2-4ae5-a083-132e600ac901

📥 Commits

Reviewing files that changed from the base of the PR and between bba5bb8 and f31b5db.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • language-server/src/core/search-engine.ts

Comment thread .jules/bolt.md Outdated
@AhmmedSamier
AhmmedSamier merged commit 440524a into master May 22, 2026
6 checks passed
@AhmmedSamier
AhmmedSamier deleted the bolt-fast-bitflag-burst-search-18266909100182459620 branch May 22, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant