Skip to content

⚡ Bolt: [performance improvement] Bulk process symbol upserts in Indexer#92

Draft
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-indexer-bulk-upserts-17930675043780213757
Draft

⚡ Bolt: [performance improvement] Bulk process symbol upserts in Indexer#92
ishaanxgupta wants to merge 1 commit intomainfrom
bolt-indexer-bulk-upserts-17930675043780213757

Conversation

@ishaanxgupta
Copy link
Member

💡 What: Replaced individual symbol upserts with bulk processing in Indexer._process_file.
🎯 Why: Indexing large files with many symbols caused severe N+1 query overhead, as each symbol change resulted in sequential write requests to MongoDB, Pinecone, and Neo4j, as well as sequential embedding generations.
📊 Impact: Significantly reduces indexing latency by batching database writes and embeddings. A file with 100 symbols will now trigger ~3 bulk API calls instead of 300 individual calls.
🔬 Measurement: Run a scan against a repository (scan_repo). Observe the overall scan duration logged in duration_seconds to verify improved performance.


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

Replaced individual symbol upserts with bulk processing in `Indexer._process_file` to reduce database overhead.
- Added `upsert_symbols_bulk` in `CodeGraphClient` using UNWIND.
- Created `embed_texts` in `src/pipelines/ingest.py` for batch embedding.
- Modified `Indexer._process_file` to collect all symbols and perform bulk inserts in Pinecone, Neo4j, and MongoDB.
@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