Commit Graph
47 Commits
Author SHA1 Message Date
David Peter 908b33cc1d Add support for showing other metrics in the terminal 2026-10-06 12:53:42 +02:00
David Peter 579b762790 Consistent display name 2026-10-05 21:02:52 +02:00
David Peter 95118147af Rename peak memory metric to memory_peak_resident 2026-10-05 20:23:55 +02:00
David Peter cf381994d1 Resolve overlap with merged measurement refactors and current master 2026-10-05 16:01:30 +02:00
David Peter 641451aea6 Use uom 2026-10-05 15:59:10 +02:00
David Peter 9ec7a9c920 Add short unit 2026-10-05 15:58:57 +02:00
David Peter d813652178 Rename to exit_code 2026-10-05 15:58:56 +02:00
David Peter d4c6b53e40 Runs => Measurements 2026-10-05 15:57:26 +02:00
David Peter af4422d212 Remove command_with_unused_parameters field 2026-10-05 15:56:52 +02:00
David Peter ae0035ad56 Use wait4 instead of getrusage 2026-10-05 15:56:37 +02:00
David Peter 50232feb22 Move user and system time 2026-10-05 15:56:36 +02:00
David Peter 14d773998a Introduce new BenchmarkRun struct 2026-10-05 15:56:36 +02:00
David Peter 463a889638 Simplify parameterized reference handling 2026-10-05 15:07:46 +02:00
David Peter f7429e2fb2 Use parameterized benchmarks as references 2026-10-05 14:59:18 +02:00
c0b3834277 Handle broken pipe errors on stdout gracefully (#932)
Replace `println!` calls on the results paths with `writeln!` on
`io::stdout()` and propagate the `io::Error` to `main`, where
`ErrorKind::BrokenPipe` is turned into a quiet `exit(0)`. This matches
the conventional behavior of command-line tools when their output pipe
is closed early (e.g. `hyperfine ... | head -n 0`), and fixes panics in
all run-output paths: the per-benchmark header and results, the speed
comparison summary, and `-`-style exports to stdout. The warnings and
"Note" outputs to stderr are converted the same way.


---------

Co-authored-by: Mathjk <Mathjk@users.noreply.github.com>
Co-authored-by: David Peter <mail@david-peter.de>
2026-10-02 11:18:56 +02:00
David Peter 4d073e08ae Dependency and MSRV update (#934) 2026-10-02 11:05:02 +02:00
Niklas Dewally 2166c9f02e Add option to name reference command
Add --reference-name option to give a reference command a name.

This was discussed in the PR that added --reference, #744, but
was unfortunately never implemented.
2025-09-03 20:45:39 +02:00
David Peter ebcf794d97 Clippy 2024-12-29 14:07:21 +01:00
David Peter 038f369420 SortOrder field 2024-12-29 14:07:21 +01:00
David Peter 0705d6c7d0 Basic scheduler test 2024-12-29 14:07:21 +01:00
Jan-Eric Nitschke 13547e973c Change message for identical time and add test for it 2024-06-30 22:45:40 +02:00
Jan-Eric Nitschke 9806ed7694 Added option to manually specify a reference to compare the results to. 2024-06-30 22:45:40 +02:00
Hamir Mahal ef1263279d style: simplify string interpolation 2024-06-01 11:07:23 +02:00
David Peter 3d4710f6e0 Clippy suggestions 2023-06-03 23:24:11 +02:00
David Peter ac617c8714 Add new --sort option
This adds a new `--sort` option to choose the way in which the results
in the speed comparison and the markup exports are ordered.

closes #614
closes #601
2023-06-03 21:34:36 +02:00
David Peter a8752769ab Show unused parameters in command names
closes #600
2023-04-20 21:39:23 +02:00
David Peter 9859ecaafe Always compute relative speed comprison for export, closes #642 2023-04-20 13:22:00 +02:00
David Peter 926b8d07c8 Improve error message, mention --shell=none 2023-04-20 13:22:00 +02:00
David Peter 2793d7b994 Do not export intermediate results to stdout, closes #640 2023-04-20 13:22:00 +02:00
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