kaivalnp commented on PR #16938:
URL: https://github.com/apache/lucene/pull/16938#issuecomment-6773202082

   Thanks @ethbak!
   
   Benchmarking this change is tricky, because it leads to a reduction in CPU + 
IO operations, but the visible impact of those are highly variable by use-case 
(depending on throughput, IOPS, read latency, running merges, etc).
   
   Setup:
   
   - AWS Graviton host, index on an EBS volume (~300 MB/s for a single 
sequential reader).
   - 500K Cohere v3 vectors, pre-indexed in 8 equal segments.
   - different runs with and without HNSW graphs (variants of the dedup vector 
format).
   - different runs with and without duplicates (a second field holding the 
main field's vector for 50% of the documents).
   - measured operation: force merge to 1 segment, 3 runs per cell.
        - hot: whole index resident in page cache, no memory limit.
        - cold: raw vector files (`.vdd`) dropped from the OS page cache right 
before; `cgroup` limit = JVM footprint + 1 GiB of page cache, which holds the 
quantized vectors and graphs but not the 2 GiB of raw vectors.
   
   |case|arm|hot (s)|raw vectors cold (s)|increase|major faults|GiB read|
   |---|---|---|---|---|---|---|
   |flat, 1 field|main|10.1|23.3|+13 s (+131%)|82|3.8|
   ||PR|9.7|23.4|+14 s (+142%)|76|3.8|
   |flat, 2 fields|main|10.6|36.9|+26 s (+248%)|7,835|5.6|
   ||PR|9.9|23.2|+13 s (+135%)|144|3.7|
   |8-bit HNSW, 1 field|main|157.5|170.5|+13 s (+8%)|84|3.8|
   ||PR|152.7|169.9|+17 s (+11%)|92|3.8|
   |8-bit HNSW, 2 fields|main|217.8|246.5|+29 s (+13%)|8,090|5.5|
   ||PR|215.2|232.2|+17 s (+8%)|109|3.7|
   
   Some thoughts:
   
   - The PR is faster for "hot" cases because vectors are not hashed 
(de-duplication is within a document, so we directly perform `equals` checks 
against a small-ish number of vectors in the same group of the document).
   - Without duplicates the PR is indistinguishable from `main`, hot or cold. 
With duplicates, `main` reads the raw vectors once for the first (superset) 
field, and the second field's sparse pass faults synchronously (~8K major 
faults vs ~100), so cold force merge is 37% faster with the PR (36.9 -> 23.2 s) 
due to a single pass merge.
   - The saving is the same ~14 s with HNSW (246.5 -> 232.2 s, 6%), but a 
smaller percentage-wise speedup because graph construction time dominates 
(unaffected by the PR).
   - In production, with concurrent merges and search IO on the same volume, 
the reduction in bytes read and synchronous faults should matter more than here.
   
   


-- 
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]

Reply via email to