mayya-sharipova opened a new pull request, #17047: URL: https://github.com/apache/lucene/pull/17047
### Description `Lucene99FlatVectorsWriter` merges a field by decoding every vector of every source segment into a `float[]` (or `short[]`/`byte[]`) and encoding it back into the same little-endian bytes. This PR copies the stored bytes directly instead, the same approach as the bulk merges of stored fields and term vectors (`Lucene90CompressingStoredFieldsWriter` / `Lucene90CompressingTermVectorsWriter`), which copy compressed chunks without decompressing them. - Used when the merge doesn't sort documents and every source returns one of the `lucene95` off-heap vector value classes, which store vector `ord` at `ord * vectorByteLength` of their slice. Otherwise it falls back to the per-vector path. - Unlike stored fields, segments with deletions still use the copy: live vectors are copied in runs between deleted docs. Runs are gathered in a 64 KB buffer so short runs don't cause partly filled writes. - `BaseKnnVectorsFormatTestCase#testRandom` now also covers float16, so merges of float16 segments with deletions are tested. Merging 10 segments × 10k vectors is 1.05–1.20x faster (1.20x for 768-dim float32); benchmark details in a comment below. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
