Commit Graph
18 Commits
Author SHA1 Message Date
David Peter d9418e0731 Use raw executor by default, skip intermediate shell
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 shell
executor, 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 due
to the fact that `bash` executes `true` as a NOP.

Co-authored: Ciprian Dorin Craciun <ciprian@volution.ro>
2022-02-22 22:51:09 +01:00
David Peter f029a46ff9 Fix clippy warnings 2022-02-22 10:13:06 +01:00
David Peter 6887835f34 Proper shell overhead computation 2022-02-22 09:07:40 +01:00
David Peter 6f51232a8a Add debug/mock mode 2022-02-22 09:07:40 +01:00
David Peter 5c9c8c2383 New Benchmark struct 2022-02-22 09:07:40 +01:00
David Peter 701a38323d Formatting 2022-02-22 09:07:40 +01:00
David Peter 8c5ae87ca2 Better error handling in run_intermediate_command 2022-02-22 09:07:40 +01:00
David Peter 662d5ca9ac Restructure run_intermediate_command 2022-02-22 09:07:40 +01:00
David Peter 021583b89b Simplify code 2022-02-22 09:07:40 +01:00
David Peter 0b5ad72872 Rename to command 2022-02-22 09:07:40 +01:00
David Peter 4cfccf1168 Rename num 2022-02-22 09:07:40 +01:00
David Peter fa2eaaac5f Move functionality into run_cleanup_command 2022-02-22 09:07:40 +01:00
David Peter ffa1c0e839 Remove more function arguments 2022-02-22 09:07:40 +01:00
David Peter 39c7736095 Move functions into Scheduler 2022-02-22 09:07:40 +01:00
David Peter dcfeede18e Move functionality to scheduler 2022-02-22 09:07:40 +01:00
David Peter 0ebd76dfc2 Turn show_output into enum 2022-02-22 09:07:40 +01:00
David Peter bf4d78dcaf Update code comments 2022-02-19 16:53:02 +01:00
David Peter 72d27729fa New Scheduler struct 2022-02-19 16:53:02 +01:00