gf2121 commented on code in PR #12833: URL: https://github.com/apache/lucene/pull/12833#discussion_r1401871396
########## lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/GroupVIntBenchmark.java: ########## @@ -103,11 +127,16 @@ void initByteBufferInput(long[] docs) throws Exception { @Setup(Level.Trial) public void init() throws Exception { long[] docs = new long[maxSize]; - int max = maxValues[numBytesPerInt]; - int min = max >> 1; - for (int i = 0; i < maxSize; i++) { - long v = ThreadLocalRandom.current().nextInt(min, max); - docs[i] = v; + Random r = new Random(0); + for (int i = 0; i < maxSize; ++i) { + float randomFloat = r.nextFloat(); + // Reproduce the distribution of the number of bits per values that we're observing for tail + // postings on wikibigall. + int numBits = Arrays.binarySearch(CUMULATIVE_FREQUENCY_BY_BITS_REQUIRED, randomFloat); + if (numBits < 0) { + numBits = -1 - numBits; + } + docs[i] = r.nextInt(1 << (numBits - 1), 1 << numBits); Review Comment: Is this correct if `randomFloat == 0.0f`? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org