-
-
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
[proposal] Ability to use time decided by the user #170
Comments
Thank you for your request (and thank you for taking the time to search old issues!) To be honest, I'm not convinced.
On the other hand, I don't want to deny that there seems to be some need for this, given that this came up a few times. If we decide to implement this in one way or the other, I'd like to discuss alternatives first. One thing that comes to my mind is something like a
(obviously, this is something you could already do now .. by running both benchmarks and subtracting the times) The problem with this approach is that there could be negative timing results (if uncertainty is involved and if the actual benchmark time is very small) |
Yeap. If a special flag is passed (probably, If the user script generates too much information, then describe it in README, suggesting to suppress stdout. Or, if possible in Rust (I'm not familiar yet) expect a value in fd3. Yeah, it's a little awkward, but we'll get a lot less information.
Exception or write some message to stdout as before: hyperfine/src/hyperfine/benchmark.rs Lines 65 to 70 in 82ee448
Just take latest.
I think we can just turn it off.
Unfortunately, it will not work properly. I tried to cheat: build Node.js application into executable file and run it as Shell. hyperfine --warmup 3 '.\build\bench /C \"\"' '.\build\bench /C \"async node-glob *\"' '.\build\bench /C \"async tiny-glob *\"' '.\build\bench /C \"async fast-glob-current *\"' (Here The measurement results are very, very different, because the subtraction produces a lot of noise at large values. In addition, require works with a very large number of files, and synchronously. Unfortunately, I did not find the results, because I gave up this idea long ago. IMHO, the manual mode is not so bad:
In fact, this will give access to more measurements on any languages. |
I think I've decided that I don't want to add this functionality to Thank you for taking the time to explain your view. |
Hi, @sharkdp,
I know that such requests have already been initiated before and have been closed: #153, #135.
But I suggest not to provide a mechanism that will allow measurements to be made inside applications. I propose to take the values of the measurements from
stdout
.We have a function
execute_and_time
where we measure the time:hyperfine/src/hyperfine/shell.rs
Lines 21 to 38 in d74ea21
Here we can get the time from
stdout
in a certain format, for example,USER_TIME, SYSTEM_TIME
. If pass an argument at startup.It turns out that we are still measuring the complete execution of the command, but where the command ends is decided by the user.
IMHO, this solution can be a compromise.
Example with Node.js
Basically, I'm interested in the question of measurements for Node.js, because the time to
require
dependencies is large and creates visual noise.The text was updated successfully, but these errors were encountered: