kaivalnp commented on code in PR #16790:
URL: https://github.com/apache/lucene/pull/16790#discussion_r4427524385


##########
lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/VectorUtilBenchmark.java:
##########
@@ -118,6 +126,21 @@ public void init() {
       floatsB[i] = random.nextFloat();
       shortsB[i] = Float.floatToFloat16(floatsB[i]);
     }
+    // Rotate through 64 vectors, as the number of descent steps depends on 
the vector. They are
+    // centered here and the centroid is zero, so scalarQuantize leaves them 
as they are and every
+    // call can be checked against the first.
+    quantizeVectors = new float[64][size];
+    expectedQuantizeResults = new 
OptimizedScalarQuantizer.QuantizationResult[64];
+    quantizeCentroid = new float[size];

Review Comment:
   Yes, I think we should do it -- perhaps we can continue with the same "copy 
to scratch" proposal you had earlier..
   
   If the copy overhead is large compared to the function being benchmarked, 
perhaps we can put it in a "setup" function with `Level.Invocation`? (which may 
not be needed if the overhead is small enough)



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