benchmark-memory icon indicating copy to clipboard operation
benchmark-memory copied to clipboard

Order comparison results by baseline similar to benchmark-ips

Open technicalpickles opened this issue 2 years ago • 2 comments

When I'm writing benchmarks, I almost always want to compare against an existing result. benchmark-ips supports this with:

Benchmark.ips do |x|
  # ...
  x.compare! order: :baseline
end

I'd love to have something similar for benchmark-memory, so that the the comparison values (ie 1.54x) is relative to the first defined report.

technicalpickles avatar Aug 31 '23 13:08 technicalpickles

Yes, this is a great idea. I'd be happy to review a PR if you want to put one together. Otherwise, I will do this the next time I have some free programming time.

It should have the same API as benchmark-ips, as you noted.

michaelherold avatar Sep 01 '23 03:09 michaelherold

@technicalpickles, would you give the branch a try before I merge and release?

michaelherold avatar Oct 13 '23 03:10 michaelherold