Skip to content

⚡ Bolt: Hoist priority scopes allocations in SearchEngine#593

Open
AhmmedSamier wants to merge 1 commit into
masterfrom
bolt/hoist-priority-scopes-6686300684543162874
Open

⚡ Bolt: Hoist priority scopes allocations in SearchEngine#593
AhmmedSamier wants to merge 1 commit into
masterfrom
bolt/hoist-priority-scopes-6686300684543162874

Conversation

@AhmmedSamier

@AhmmedSamier AhmmedSamier commented Jul 22, 2026

Copy link
Copy Markdown
Owner
  • 💡 What: Hoisted BURST_PRIORITY_SCOPES and IS_BURST_PRIORITY_TYPE_ID to module-level constants.
  • 🎯 Why: To eliminate unnecessary allocations and garbage collection overhead during burst searches.
  • 📊 Impact: Improves burst search performance by avoiding repetitive object allocations on every call.
  • 🔬 Measurement: Verified that tests continue to pass and allocations are reduced in the hot path.

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

Summary by CodeRabbit

  • Performance
    • Improved search responsiveness during burst searches by reducing repeated internal processing.
    • Optimized priority filtering and fallback scanning for more efficient search execution.

Hoisted `BURST_PRIORITY_SCOPES` and `IS_BURST_PRIORITY_TYPE_ID` to module-level constants to eliminate unnecessary allocations and garbage collection overhead during burst searches.

Co-authored-by: AhmmedSamier <[email protected]>
@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 Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The burst-search implementation hoists priority scopes and type-ID filtering data to module-level constants, replacing per-search Set and Uint8Array allocations in priority and remaining-item scans. Documentation records the optimization.

Changes

Burst search allocation hoisting

Layer / File(s) Summary
Priority configuration and orchestration
language-server/src/core/search-engine.ts, .jules/bolt.md
Defines reusable burst-priority scopes and a precomputed type-ID lookup, then uses the shared scopes for priority searches. Documentation records the allocation change.
Remaining-item priority filtering
language-server/src/core/search-engine.ts
Uses the precomputed lookup while scanning remaining items instead of constructing per-call filtering structures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: codex

🚥 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 clearly summarizes the main change: hoisting priority-scope allocations in SearchEngine for burst-search optimization.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/hoist-priority-scopes-6686300684543162874

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

@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:
- Around line 106-108: Correct the changelog entry date for “Hoist Allocations
Out of Search Hot Loops” to the actual change date, likely 2026-07-22, or
relocate the entry so the surrounding entries remain in chronological order.
🪄 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: 71027ed9-c4f5-48cc-97e2-d9d57ce114f8

📥 Commits

Reviewing files that changed from the base of the PR and between 35dd4d7 and 23ced78.

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

Comment thread .jules/bolt.md
Comment on lines +106 to +108
## 2025-07-22 - [Hoist Allocations Out of Search Hot Loops]
**Learning:** Creating `new Set` and `new Uint8Array(256)` dynamically within `searchRemainingItems` during burst searches adds redundant GC overhead.
**Action:** Hoist constant priority scope sets and type ID mappings to module-level precomputed constants to eliminate allocation during hot loops.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the optimization entry date or ordering.

This section is dated July 22, 2025, but follows entries dated May 3, 2026 and May 6, 2026. Use the actual change date—likely July 22, 2026—or move the entry to preserve chronological order.

🤖 Prompt for 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.

In @.jules/bolt.md around lines 106 - 108, Correct the changelog entry date for
“Hoist Allocations Out of Search Hot Loops” to the actual change date, likely
2026-07-22, or relocate the entry so the surrounding entries remain in
chronological order.

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