JuliaCI/BenchmarkTools.jl

Document units of memory and time properties of Trial type

vandre opened this issue · 0 comments

vandre commented

Running a benchmark produces an instance of the Trial Type.

When running on the REPL it is nice that you can see a pretty-printed version of the results, however it is not as straightforward to save those results to a text file.

The manual states that we can calculate the metrics ourselves by using the minimum,median,mean,maximum, and std functions, i.e.

julia> maximum(t)
BenchmarkTools.TrialEstimate: 
  time:             1.503 ms
  gctime:           1.401 ms (93.21%)
  memory:           16.36 KiB
  allocs:           19

What it is not immediately obvious is the actual unit that the metrics are saved as internally. Through trial an error I found out that memory is stored as bytes and time is stored as nanoseconds, i.e.

julia> mean(t).time
1.503e6