Project
vgrep
Description
The embed_batch() function creates a new LlamaContext for every batch of texts to embed. This is expensive as context creation involves memory allocation and initialization. The context should be reused across batches.
Error Message
None - performance issue.
Debug Logs
System Information
- Bounty Version: 0.1.0
- OS: Ubuntu 24.04 LTS
- Rust: 1.75+
Screenshots
No response
Steps to Reproduce
- Index a large project with many files
- Observe that embedding is slower than expected
- Each batch call recreates the context
Expected Behavior
- Create context once during
EmbeddingEngine::new()
- Reuse context for all embedding operations
- Use configured
n_threads instead of recalculating
Actual Behavior
- Every
embed_batch() call creates a new context
- Thread count is queried from OS every time
- Significant overhead for many small batches
Additional Context
No response
Project
vgrep
Description
The
embed_batch()function creates a newLlamaContextfor every batch of texts to embed. This is expensive as context creation involves memory allocation and initialization. The context should be reused across batches.Error Message
Debug Logs
System Information
Screenshots
No response
Steps to Reproduce
Expected Behavior
EmbeddingEngine::new()n_threadsinstead of recalculatingActual Behavior
embed_batch()call creates a new contextAdditional Context
No response