Skip to content
Merged
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
4 changes: 3 additions & 1 deletion tool/lib/core_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,9 @@ def assert_linear_performance(seq, rehearsal: nil, pre: ->(n) {n})
end
times.compact!
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment why we use this calculation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})"

seq.each do |i|
Expand Down