Skip to content

⚡ Bolt: [performance improvement] Batch multi-repository searches#94

Draft
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-perf-batch-repo-search-4929642124094257111
Draft

⚡ Bolt: [performance improvement] Batch multi-repository searches#94
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-perf-batch-repo-search-4929642124094257111

Conversation

@ishaanxgupta
Copy link
Member

💡 What: Replaced sequential iteration over repositories in _search_symbols and _search_files with batched asyncio.gather requests that collect results concurrently, followed by a flat mapping of the results.

🎯 Why: To solve an N+1 query bottleneck. Previously, if the repo parameter was not provided, the CodeRetrievalPipeline would run await self._search_namespace on each attached repository one by one. This forced the pipeline's latency to scale linearly with the number of attached repositories.

📊 Impact: Reduces multi-repository search latency by O(N), where N is the number of attached repositories. For an organization with 10 repositories, this effectively transforms 10 sequential network/database calls into 1 concurrent block, yielding nearly a 10x speedup for those operations.

🔬 Measurement: A benchmarking script simulating the network latency confirmed a drop from 1.00s (sequential) to 0.10s (concurrent) for 10 mock repositories. To verify in production, measure the end-to-end execution time of run() on queries omitting the repo argument before and after this change.


PR created automatically by Jules for task 4929642124094257111 started by @ishaanxgupta

Refactored `_search_symbols` and `_search_files` to execute concurrent requests via `asyncio.gather` when querying across multiple repositories.

Also fixed a lint error regarding an unused import (`directories_namespace`).
@google-labs-jules
Copy link

👋 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.

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