Commit Graph
57 Commits
Author SHA1 Message Date
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
David Peter 038f369420 SortOrder field 2024-12-29 14:07:21 +01:00
David Peter 0d2e3a4dd7 Simplify CSV tests 2024-12-29 14:07:21 +01:00
David Peter da399ab654 Move more tests to insta 2024-12-29 14:07:21 +01:00
David Peter 7a9d04d35c Use insta for exporter tests 2024-12-29 14:07:21 +01:00
David Peter 6556b2bd46 Initial work on tracking memory usage 2024-12-29 12:18:55 +01: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 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 2793d7b994 Do not export intermediate results to stdout, closes #640 2023-04-20 13:22:00 +02:00
David Peter c44aa1d006 Fix clippy suggestions 2023-03-15 10:13:58 +01:00
David Peter 5f5adda8b4 Prevent creation of file named '-' 2023-03-15 10:13:58 +01:00
Humble Penguin e50050f53d removed unused imports 2023-03-15 09:34:29 +01:00
Humble Penguin 9d0f67838f used cfg!(windows) instead of env::consts::OS 2023-03-15 09:34:29 +01:00
Humble Penguin acf156e5d4 ran cargo fmt 2023-03-15 09:34:29 +01:00
Humble Penguin bbe706bcc1 PR for issue #615 2023-03-15 09:34:29 +01:00
Benjamin Rombaut 5fcb7166a9 add clap deprecation notices 2022-11-19 15:13:30 +01:00
David Peter c7e56942f7 Fix clippy suggestions 2022-09-07 09:20:50 +02:00
Philipp Paulweber 5e655032bc Refactor AsciiDocExporter emitting using the MarkupExporter trait 2022-05-26 22:38:25 +02:00
David Peter ec4321392f Fix clippy warnings 2022-05-17 22:57:10 +02:00
David Peter eb0ccc85f1 Adapt to new markup exporter changes 2022-05-15 21:57:35 +02:00
Philipp Paulweber 2443383fc8 Export of Emacs org-mode table support
* added new command-line option '--export-orgmode <FILE>' to create
  Emacs org-mode table output by reusing markup result formatting
* based on the new MarkdownFormatter trait, see PR #490
2022-05-15 21:57:35 +02:00
David Peter e3bc5b8b25 Simplify test 2022-05-15 21:37:40 +02:00
David Peter 8c05fd030d table_line => table_divider 2022-05-15 21:37:40 +02:00
David Peter 5cd2821266 table_data => table_row 2022-05-15 21:37:40 +02:00
David Peter 7fdb32d202 Remove superfluous newline 2022-05-15 21:37:40 +02:00
David Peter 339f6661ce Move determine_unit_from_results 2022-05-15 21:37:40 +02:00
David Peter 4cdf2d5152 Implement Exporter for all MarkupExporters 2022-05-15 21:37:40 +02:00
David Peter 9a46bcc390 Remove the TestExporter 2022-05-15 21:37:40 +02:00
David Peter 6fe7738165 Do not pass 'unit' into determine_unit_from_results 2022-05-15 21:37:40 +02:00
David Peter 8741d05d11 Move Exporter::unit => determine_unit_from_results 2022-05-15 21:37:40 +02:00
Philipp Paulweber 69d38a5f8e Refactor MarkupExporter to omit intermediate table result creation and simplify MarkupFormatter emitting
* see: https://github.com/sharkdp/hyperfine/pull/490#pullrequestreview-932424652
2022-05-15 21:37:40 +02:00
Philipp Paulweber 9dc87ac349 Refactor MarkdownExporter emitting using a generic MarkupFormatter trait
* see: https://github.com/sharkdp/hyperfine/pull/490#issuecomment-1076784074
2022-05-15 21:37:40 +02:00
Philipp Paulweber 50cf7de915 Refactor Markdown table emitting to generic Markup function 2022-05-15 21:37:40 +02:00
Philipp Paulweber 3b1fc32626 Refactor Markdown table contents generation to generic Markup function 2022-05-15 21:37:40 +02:00
Philipp Paulweber 23d9fe2595 Refactor Markdown with Markup by using generic table emitter 2022-05-15 21:37:40 +02:00
David Peter dcfeede18e Move functionality to scheduler 2022-02-22 09:07:40 +01:00
David Peter 5c634c9f2f Move a few modules to util 2022-02-06 20:19:50 +01:00
David Peter 999e7c4566 Move more modules around 2022-02-06 20:19:50 +01:00
David Peter 865290a144 New output module 2022-02-06 20:19:50 +01:00
David Peter e5e4c8c020 New 'benchmark' module folder 2022-02-06 20:19:50 +01:00
David Peter 33f8d03d6b Move build_export_manager to ExportManager 2022-02-06 20:19:50 +01:00
David Peter d7e96928fb Fix format call 2022-02-06 20:19:50 +01:00
David Peter 2040810ce3 Unified error handling 2022-02-06 20:19:50 +01:00
David Peter 81b737fdc1 Remove BenchmarkResult::new 2022-02-06 20:19:50 +01:00
David Peter f5de5487cc Fix clippy suggestions 2022-02-06 17:47:40 +01:00
Karl Heinz Marbaise 272b107684 Fixed #452 - Difference between markdown and asciidoctor output 2021-12-03 09:11:49 +01:00