Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the benchmark warmup time to avoid warmup artifact #355

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion benchmarks/benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,12 @@ def positional_splat_keyword_and_double_splat_args(a, *args, b:, **kwargs)
json_file = Tempfile.new

Benchmark.ips do |x|
x.config(suite: suite)
# One user reported that a warmup time of 5 seconds was the minimum needed
# for them to not see whichever MemoWise version (local or GitHub main) runs
# last getting a speed improvement because Ruby is able to optimize it
# better, so we use a 6-second warmup to be safe.
# See: https://github.com/panorama-ed/memo_wise/issues/349#issuecomment-2374754550
x.config(suite: suite, warmup: 6)
BENCHMARK_GEMS.each do |benchmark_gem|
instance = Object.const_get("#{benchmark_gem.klass}Example").new

Expand Down