Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document units of memory and time properties of Trial type #307

Open
vandre opened this issue May 2, 2023 · 0 comments
Open

Document units of memory and time properties of Trial type #307

vandre opened this issue May 2, 2023 · 0 comments

Comments

@vandre
Copy link

vandre commented May 2, 2023

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
@gdalle gdalle added this to the v2.0 milestone Sep 18, 2023
@gdalle gdalle removed this from the v2.0 milestone Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants