Skip to content

Commit 479b0e0

Browse files
authored
Add new cli options to control the benchmark iterations and warmups
2 parents bbe3292 + b98d3f4 commit 479b0e0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ While benchmarking an indexing side change, you might want to recreate the index
110110
python src/python/localrun.py -source wikimediumall -r
111111
```
112112

113+
For quick patch testing, you can control the number of JVM iterations and query repetitions to speed up the benchmark:
114+
```bash
115+
# Quick test: 5 JVM iterations, 10 query repetitions per JVM
116+
python src/python/localrun.py -source wikimediumall -iterations 5 -warmups 10
117+
118+
# Full benchmark (default): 20 JVM iterations, 20 query repetitions per JVM
119+
python src/python/localrun.py -source wikimediumall -iterations 20 -warmups 20
120+
```
121+
122+
**Note:** The `-iterations` parameter controls how many separate JVM processes are launched (default: 20), and `-warmups` controls how many times each query runs within a single JVM (default: 20). Running with default settings (20×20) provides the most statistically reliable results and recommended for benchmarks testing to get a complete picture. For quick patch validation, reducing these values significantly speeds up testing.
123+
113124
For details on all the available options, use the `-h` or `--help` parameter.
114125

115126
# Running the geo benchmark

src/python/example.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929
parser.add_argument("-b", "--baseline", default=os.environ.get("BASELINE") or "lucene_baseline", help="Path to lucene repo to be used for baseline")
3030
parser.add_argument("-c", "--candidate", default=os.environ.get("CANDIDATE") or "lucene_candidate", help="Path to lucene repo to be used for candidate")
3131
parser.add_argument("-r", "--reindex", action="store_true", help="Reindex data for candidate run")
32+
parser.add_argument("-iterations", "--iterations", default=20, type=int, help="Number of JVM iterations (separate JVM processes, default: 20)")
33+
parser.add_argument("-warmups", "--warmups", default=20, type=int, help="Number of times each query runs within a single JVM for warmup (default: 20)")
3234
args = parser.parse_args()
3335
print("Running benchmarks with the following args: %s" % args)
3436

3537
sourceData = competition.sourceData(args.source)
3638
countsAreCorrect = args.searchConcurrency != 0
37-
comp = competition.Competition(verifyCounts=not countsAreCorrect)
39+
comp = competition.Competition(verifyCounts=not countsAreCorrect, jvmCount=args.iterations, taskRepeatCount=args.warmups)
3840

3941
index = comp.newIndex(
4042
args.baseline,

0 commit comments

Comments
 (0)