Closed anapsix closed 3 years ago
switch to Time.measure in place of Benchmark.measure for simplification and performance, as alternative to https://github.com/robacarp/mosquito/pull/56
Time.measure
Benchmark.measure
Benchmark.measure appears to be slower, compared to Time.measure
require "benchmark" Benchmark.ips do |x| x.report("benchmark") { Benchmark.measure do Int64.new(2) end } x.report("time") { Time.measure do Int64.new(2) end } end
benchmark 494.87k ( 2.02µs) (± 5.95%) 64.0B/op 27.18× slower time 13.45M ( 74.34ns) (± 4.62%) 0.0B/op fastest
I think I prefer time.measure. The Benchmark system provides a bunch of extra logic which is unnecessary here. Thank you for submitting both pulls.
switch to
Time.measure
in place ofBenchmark.measure
for simplification and performance, as alternative to https://github.com/robacarp/mosquito/pull/56Benchmark.measure
appears to be slower, compared toTime.measure