-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
output median #171
Comments
Thank you for your feedback!
I'm not sure. I want hyperfine to be a very easy-to-use tool. This also means that I would like the output to be easily readable and understandable.
Yes. For this reason, hyperfine/src/hyperfine/outlier_detection.rs Lines 1 to 34 in b089eda
If a cron job would fire in the middle of the benchmark, the outlier detection would hopefully catch this. For example: ▶ hyperfine 'md5sum $(which hyperfine)' &; sleep 2 && stress --cpu 12 --timeout 1 --quiet
Time (mean ± σ): 17.8 ms ± 19.4 ms [User: 11.9 ms, System: 1.9 ms]
Range (min … max): 12.2 ms … 122.0 ms 193 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark
on a quiet PC without any interferences from other programs. It might help to
use the '--warmup' or '--prepare' options. Here, we run a benchmark for
Interesting. Did you see any arguments why the median is preferred over the mean? Just because it's robust against outliers? I would be great if you could include the references here. |
Oh.. also: did you see the https://github.com/sharkdp/hyperfine/tree/master/scripts For the benchmark example above, the
(granted, this demonstrates quite well that the median is a robust measure) |
Thank you for the thorough answer!
> Do you think it's good to output the median (instead of, or in addition to) the mean?
I'm not sure. I want hyperfine to be a very easy-to-use tool. This also means that I would like the output to be easily readable and understandable.
That's the reason I like hyperfine. :)
I'd be fine with printing the median (or even all quartiles) only at
--export-json or --export-csv.
> If cron fires during a benchmark, the mean might be off
Yes. For this reason, `hyperfine` include a statistical outlier detection:
Yes, I get the outliers warnings often, e.g. at
hyperfine --warmup 10 -r 100 "/bin/ls" "/usr/local/bin/exa"
After quitting cron and most programs, and disabling CPU adjustment there
are less warnings, but they're still there. I guess, you can't completely
get rid of them on a multitasking OS.
> It seems many academic papers prefer the median.
Interesting. Did you see any arguments why the median is preferred over the mean? Just because it's robust against outliers? I would be great if you could include the references here.
I liked this paper (*Besser Benchmarken*) as a general introduction:
https://pp.info.uni-karlsruhe.de/uploads/publikationen/bechberger16bachelorarbeit.pdf
This paper (*The correct way to summarize benchmark results*) objects
the mean for *normalized* numbers:
https://www.cse.unsw.edu.au/~cs9242/18/papers/Fleming_Wallace_86.pdf
Don't get me wrong: I'm not complaining about hyperfine. IMO it's better
then any other benchmarking tool as is.
|
Oh.. also: did you see the `scripts/` folder?
Yes, but I felt it may be worth to do it natively...
(TBH, I try to avoid external dependencies in python because of this:
https://xkcd.com/1987/)
|
That's certainly something we can implement 👍
When benchmarking I/O heavy programs like
That's certainly true, yes.
Great, thank you for the references! I will have a look.
No worries, I didn't get you wrong. I'm very grateful for every feedback I can get! If there are good reasons for showing the median instead of the mean (by default, in the terminal output), I'm also open to changing this behavior.
Adding the median is certainly something we can do within hyperfine, yes.
The scripts I provide are really more meant as a starting point for "power users" that want to further analyze the benchmark results. I also hate Pythons package management ecosystem, but what can I do? How would I avoid using something like matplotlib? |
That's certainly something we can implement 👍
Great. I didn't manage to wrap my head around Rust's syntax yet.
Otherwise I'd probably send you a PR.
The scripts I provide are really more meant as a starting point for "power users" that want to further analyze the benchmark results. I also hate Pythons package management ecosystem, but what can I do? How would I avoid using something like matplotlib?
For ordinary plots gnuplot is not bad, e.g.:
$ cat | gnuplot -p -e "plot '<cat' with lines"
0 0
1 2
3 4
4 8
…-p is for "persist".
-e is for "execute".
|
I use |
Implemented in #176 |
Released in v1.6.0. |
Thank you a lot!
|
I'd like to measure the median instead of the mean. Currently, I have a perl script that reads the JSON output and calculates the quartiles. But that's not very convenient. Do you think it's good to output the median (instead of, or in addition to) the mean?
Here are some points:
PS: Thanks for hyperfine. It's much more convenient than time.
The text was updated successfully, but these errors were encountered: