Update README.md

This commit is contained in:
David Peter 2022-03-05 12:52:02 +01:00 committed by GitHub
parent 02157eb6ca
commit 73efc650de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,11 +128,14 @@ hyperfine 'source /tmp/my_function.sh; eval my_function'
hyperfine 'source /tmp/my_alias.sh; eval my_alias' hyperfine 'source /tmp/my_alias.sh; eval my_alias'
``` ```
### Export results ### Exporting results
Hyperfine has multiple options for exporting benchmark results: CSV, JSON, Markdown (see `--help` Hyperfine has multiple options for exporting benchmark results to CSV, JSON, Markdown and other
text for details). To export results to Markdown, for example, you can use the `--export-markdown` formats (see `--help` text for details).
option that will create tables like this:
#### Markdown
You can use the `--export-markdown <file>` option to create tables like the following:
| Command | Mean [s] | Min [s] | Max [s] | Relative | | Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:| |:---|---:|---:|---:|---:|
@ -140,8 +143,14 @@ option that will create tables like this:
| `find . -iname '*[0-9].jpg'` | 1.427 ± 0.026 | 1.405 | 1.468 | 6.14 ± 0.13 | | `find . -iname '*[0-9].jpg'` | 1.427 ± 0.026 | 1.405 | 1.468 | 6.14 ± 0.13 |
| `fd -HI '.*[0-9]\.jpg$'` | 0.232 ± 0.002 | 0.230 | 0.236 | 1.00 | | `fd -HI '.*[0-9]\.jpg$'` | 0.232 ± 0.002 | 0.230 | 0.236 | 1.00 |
The JSON output is useful if you want to analyze the benchmark results in more detail. See the #### JSON
[`scripts/`](https://github.com/sharkdp/hyperfine/tree/master/scripts) folder for some examples.
The JSON output is useful if you want to analyze the benchmark results in more detail. The
[`scripts/`](https://github.com/sharkdp/hyperfine/tree/master/scripts) folder includes a lot
of helpful Python programs to further analyze benchmark results and create helpful
visualizations, like a histogram of runtimes:
![](doc/histogram.png)
## Installation ## Installation