mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Improve base time of assert_linear_performance (#11369)
Remove `.ceil` from base time calculation that makes 10x gap. This will make the assertion more strict and also less flaky.
This commit is contained in:
parent
af17a34c88
commit
b33c331184
1 changed files with 3 additions and 1 deletions
|
@ -768,7 +768,9 @@ eom
|
||||||
end
|
end
|
||||||
times.compact!
|
times.compact!
|
||||||
tmin, tmax = times.minmax
|
tmin, tmax = times.minmax
|
||||||
tbase = 10 ** Math.log10(tmax * ([(tmax / tmin), 2].max ** 2)).ceil
|
|
||||||
|
# safe_factor * tmax * rehearsal_time_variance_factor(equals to 1 when variance is small)
|
||||||
|
tbase = 10 * tmax * [(tmax / tmin) ** 2 / 4, 1].max
|
||||||
info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})"
|
info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})"
|
||||||
|
|
||||||
seq.each do |i|
|
seq.each do |i|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue