Use raw executor by default, skip intermediate shell #487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new "raw executor" (next to the "shell executor") that
allows hyperfine to execute commands directly without any intermediate
shell.
The command line is split into tokens (using the
shell-words
crate),and according to POSIX rules. The first token is taken as the executable,
and the rest as arguments.
The new executor is enabled by default. In order to select the shellexecutor, users will have to pass
--shell=default
.This allows us to reduce measurement noise and to benchmark very quick
commands. It also decreases the time to run benchmarks, as we don't need
the calibration phase.
Also, it allows one to make sure that the executed command is not
implemented as a shell builtin. For example
hyperfine true
and
hyperfine --shell=default true
return different times dueto the fact that
bash
executestrue
as a NOP.Co-authored: Ciprian Dorin Craciun [email protected]
To do:
hyperfine "fd . ~"
). And this could lead to surprising results:hyperfine "echo hi && sleep 0.1"
would result inecho 'hi' '&&' 'sleep' '0.1'
--help
text (regarding--shell=default
and<command>
)