BenchmarkTools.jl icon indicating copy to clipboard operation
BenchmarkTools.jl copied to clipboard

common histogram bounds when displaying multiple benchmarks

Open StefanKarpinski opened this issue 4 years ago • 2 comments

@timholy just implemented manual histogram bounds in https://github.com/JuliaCI/BenchmarkTools.jl/pull/255, but it occurred to me that when you display multiple benchmarks together (in an array, for example), then it would be even nicer to figure out common histogram bounds for all the benchmarks.

StefanKarpinski avatar Sep 16 '21 19:09 StefanKarpinski

Looks like this currently:

julia> b1 = @benchmark sum(b) setup=(b = rand(Int32, 10^4));

julia> b2 = @benchmark sum(a) setup=(a = reinterpret(reshape, Int32, rand(UInt8, 4, 10^4)));

julia> [b1, b2]
2-element Vector{BenchmarkTools.Trial}:
 913.368 ns
 845.129 ns

This must come from the 2-arg show.

timholy avatar Sep 16 '21 19:09 timholy

Ah yes, that makes sense—if you have a bunch of benchmarks in an array, you probably want a terse display. There could be a specific function to display a collection of benchmarks as a comparison.

StefanKarpinski avatar Sep 16 '21 19:09 StefanKarpinski