From 6273aa9b250b41b4a9dd8ded24a511b0882c6cb4 Mon Sep 17 00:00:00 2001 From: "guofeng.my" Date: Sat, 8 Feb 2025 17:49:42 +0800 Subject: [PATCH] iter --- .../org/apache/lucene/benchmark/jmh/BKDCodecBenchmark.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/BKDCodecBenchmark.java b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/BKDCodecBenchmark.java index 15c910f729e..f4b1a9865d7 100644 --- a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/BKDCodecBenchmark.java +++ b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/BKDCodecBenchmark.java @@ -100,8 +100,12 @@ public void tearDownTrial() throws IOException { IOUtils.close(legacyIn, vectorIn, dir); } + /** + * It is important to make count variable, like what will happen in real BKD leaves. If this + * method constantly return 512, {@link #current} will run as fast as {@link #currentVector}. + */ private static int count(int iter) { - // to make benchmark more realistic + // return 512; return iter % 20 == 0 ? 511 : SIZE; }