⚡ Bolt: [performance improvement] Batch multi-repository searches#94
⚡ Bolt: [performance improvement] Batch multi-repository searches#94ishaanxgupta wants to merge 1 commit intomainfrom
Conversation
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`).
|
👋 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. |
💡 What: Replaced sequential iteration over repositories in
_search_symbolsand_search_fileswith batchedasyncio.gatherrequests that collect results concurrently, followed by a flat mapping of the results.🎯 Why: To solve an N+1 query bottleneck. Previously, if the
repoparameter was not provided, theCodeRetrievalPipelinewould runawait self._search_namespaceon 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 therepoargument before and after this change.PR created automatically by Jules for task 4929642124094257111 started by @ishaanxgupta