Skip to content

Commit

Permalink
[NO-TICKET] Tweak duration of profiler_sample_serialize benchmark
Browse files Browse the repository at this point in the history
**What does this PR do?**

This PR tweaks the default duration of the
`benchmarks/profiler_sample_serialize.rb` benchmark. This duration
gets used when we run benchmarks on every PR.

**Motivation:**

We've been seeing quite a bit of variance in the benchmarks from
run-to-run which makes it seem like there are regressions/improvements
even when nothing of consequence is touched (e.g. PR that changes docs
even).

This got better when we adjusted the thresholds used by the benchmarking
platform, but I'm still seeing this benchmark in particular show up
quite often in a "flaky" way.

I suspect this behavior may be because each step on this benchmark takes
more than one second (since it simulates 60 seconds of profiling data)
and thus the low number of iterations creates more noise.

I'm hoping that by raising the duration of this benchmark to 1 minute
we'll see the run-to-run variation go down.

**Additional Notes:**

N/A

**How to test the change?**

Validate benchmark is running for 1 minute in CI.
  • Loading branch information
ivoanjo committed Sep 19, 2024
1 parent f6ec8b7 commit 3b54135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmarks/profiler_sample_serialize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_profiler

def run_benchmark
Benchmark.ips do |x|
benchmark_time = VALIDATE_BENCHMARK_MODE ? { time: 0.01, warmup: 0 } : { time: 10, warmup: 2 }
benchmark_time = VALIDATE_BENCHMARK_MODE ? { time: 0.01, warmup: 0 } : { time: 60, warmup: 2 }
x.config(
**benchmark_time,
)
Expand Down

0 comments on commit 3b54135

Please sign in to comment.