Skip to content

Commit 51396ba

Browse files
authored
Adjust num_itrs_hint for activerecord (#317)
1 parent c4077b3 commit 51396ba

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

benchmarks/activerecord/benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def run
7676

7777
run # heat any caches
7878

79-
run_benchmark(300) do
79+
run_benchmark(20) do
8080
10.times do
8181
run
8282
end

harness-perf/harness.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212

1313
require_relative "../harness/harness-common"
1414

15-
# Takes a block as input
15+
# Run $WARMUP_ITRS or 10 iterations of a given block. Then run $MIN_BENCH_ITRS
16+
# or `num_itrs_int` iterations of the block, attaching a perf command to the
17+
# benchmark process.
18+
#
19+
# `num_itrs_hint` should be close to what the default harness would use as
20+
# the number of benchmark iterations. For example, if the default harness runs
21+
# 10 benchmark iterations (after 15 warmup iterations) for a benchmark with
22+
# the default MIN_BENCH_TIME, the benchmark should have 10 as `num_itrs_hint`.
1623
def run_benchmark(num_itrs_hint)
1724
warmup_itrs = Integer(ENV.fetch('WARMUP_ITRS', 10))
1825
bench_itrs = Integer(ENV.fetch('MIN_BENCH_ITRS', num_itrs_hint))

0 commit comments

Comments
 (0)