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

Support for running a number of times that is not determined in advance #594

Open
jeanas opened this issue Dec 22, 2022 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@jeanas
Copy link

jeanas commented Dec 22, 2022

Hi!

Suppose that I am trying to optimize a tool and I want to have a precise view of the performance impact of a given change. I can use hyperfine to compare a run of the tool with a run of a modified version of the tool, and it detects the number of iterations to perform automatically according to the duration of the first run. However, I may or may not be happy with this number of iterations, depending on how the comparison turns out to be. If it's very clear after 3 runs of each that the change improves/degrades performance a lot, I can just stop. If it's not clear but I am still interested in a precise measure, I will want to run more, say 50, so that the statistical variations average out to give a more precise value of the mean. Before discovering hyperfine, I was using a hand-made tool that runs the processes alternatively (relates to #21), and prints the standard error of the mean live (N.B. not standard deviation, cf. https://en.wikipedia.org/wiki/Standard_error; I think the "σ" value hyperfine prints is the standard deviation?), allowing me to stop when I am happy with the significance of the comparison.

This feature request is a superset of #21: in addition to alternating the runs, it would mean printing an error estimate while benchmarking too (not only the mean estimate like hyperfine currently does), and supporting a mode where benchmarking never stops until interrupted by Ctrl-C (I guess this would only differ from -r 1000000 by not printing something similar to "run x out of 1000000).

Thanks for this tool, and thanks for your interest.

@sharkdp
Copy link
Owner

sharkdp commented Jan 14, 2023

Thank you for your request. This sounds like a very useful feature. Any help in designing the details of this (CLI, implementation idea, …) would be very much appreciated

@sharkdp
Copy link
Owner

sharkdp commented Apr 17, 2023

See also: #523

@sharkdp sharkdp added the help wanted Extra attention is needed label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants