This is an automated email from the ASF dual-hosted git repository.

Jackie-Jiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new d40dcebf1b0 Fix shared Random and low repeat ratio in 
BenchmarkIndexedTable (#19368)
d40dcebf1b0 is described below

commit d40dcebf1b0a9dd689403be0df771c069cd20059
Author: scottlan0113 <[email protected]>
AuthorDate: Tue Aug 25 21:08:36 2026 -0500

    Fix shared Random and low repeat ratio in BenchmarkIndexedTable (#19368)
---
 .../main/java/org/apache/pinot/perf/BenchmarkIndexedTable.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkIndexedTable.java 
b/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkIndexedTable.java
index c6e3f25f2a9..666b5e9211f 100644
--- a/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkIndexedTable.java
+++ b/pinot-perf/src/main/java/org/apache/pinot/perf/BenchmarkIndexedTable.java
@@ -21,7 +21,6 @@ package org.apache.pinot.perf;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
@@ -29,6 +28,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import org.apache.commons.lang3.RandomStringUtils;
@@ -58,8 +58,7 @@ import org.openjdk.jmh.runner.options.TimeValue;
 public class BenchmarkIndexedTable {
   private static final int TRIM_SIZE = 800;
   private static final int TRIM_THRESHOLD = TRIM_SIZE * 4;
-  private static final int NUM_RECORDS = 1000;
-  private static final Random RANDOM = new Random();
+  private static final int NUM_RECORDS = 100_000;
 
   private QueryContext _queryContext;
   private DataSchema _dataSchema;
@@ -102,9 +101,10 @@ public class BenchmarkIndexedTable {
   }
 
   private Record getNewRecord() {
+    ThreadLocalRandom random = ThreadLocalRandom.current();
     Object[] columns = new Object[]{
-        _d1.get(RANDOM.nextInt(_d1.size())), 
_d2.get(RANDOM.nextInt(_d2.size())), (double) RANDOM.nextInt(1000),
-        (double) RANDOM.nextInt(1000)
+        _d1.get(random.nextInt(_d1.size())), 
_d2.get(random.nextInt(_d2.size())), (double) random.nextInt(1000),
+        (double) random.nextInt(1000)
     };
     return new Record(columns);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to