mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-18 12:08:35 +00:00
4494eb9e56
Implement parallel execution of multiple embedding functions using std::thread::scope to improve performance when a table has multiple embedding columns. Key changes: - Add compute_embeddings_parallel() helper method to WithEmbeddings - Use fast path for single embeddings (no threading overhead) - Use scoped threads for parallel execution of multiple embeddings - Add comprehensive tests including parallelization timing verification - Update WithEmbeddings documentation Performance improvements: - I/O-bound embeddings (OpenAI, Bedrock): High benefit from concurrent API calls - CPU-bound embeddings (sentence-transformers): Medium benefit from core utilization - Single embedding: No overhead (fast path) Closes TODO on line 266 in rust/lancedb/src/embeddings.rs