Method: Minitest::Benchmark#assert_performance_logarithmic

Defined in:
lib/minitest/benchmark.rb

#assert_performance_logarithmic(threshold = 0.99, &work) ⇒ Object

Runs the given work and asserts that the times gathered fit to match a logarithmic curve within a given error threshold.

Fit is calculated by #fit_logarithmic.

Ranges are specified by ::bench_range.

Eg:

def bench_algorithm
  assert_performance_logarithmic 0.9999 do |n|
    @obj.algorithm(n)
  end
end


174
175
176
# File 'lib/minitest/benchmark.rb', line 174

def assert_performance_logarithmic threshold = 0.99, &work
  assert_performance validation_for_fit(:logarithmic, threshold), &work
end