Skip to content

Commit

Permalink
Adjust num_itrs_hint for activerecord
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Aug 8, 2024
1 parent c4077b3 commit af6ee58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchmarks/activerecord/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def run

run # heat any caches

run_benchmark(300) do
run_benchmark(20) do
10.times do
run
end
Expand Down
9 changes: 8 additions & 1 deletion harness-perf/harness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

require_relative "../harness/harness-common"

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

0 comments on commit af6ee58

Please sign in to comment.