From 355765e7bf4f23060927d881ae55afec9e668255 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 24 Mar 2018 21:13:51 +0100 Subject: [PATCH] Update Markdown format --- README.md | 11 +++++------ src/hyperfine/export/markdown.rs | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ce3b8a204..964434332 100644 --- a/README.md +++ b/README.md @@ -76,12 +76,11 @@ Hyperfine has multiple options for exporting benchmark results: CSV, JSON, Markd text for details). To export results to Markdown, for example, you can use the `--export-markdown` option that will create tables like this: -| Benchmark | Mean [ms] | Min. [ms] | Max. [ms] | -|----|----|----|----| -| `find ~ -iregex '.*[0-9]\.jpg$'` | 6911.0 ± 44.2 | 6837.5 | 6968.2 | -| `find ~ -iname '*[0-9].jpg'` | 3747.7 ± 29.1 | 3711.5 | 3801.5 | -| `fd -HI '[0-9]\.jpg$' ~` | 803.7 ± 33.4 | 784.7 | 882.9 | -| `fd '.*[0-9]\.jpg$' ~` | 122.0 ± 2.1 | 120.0 | 129.5 | +| Command | Mean [ms] | Min…Max [ms] | +|:---|---:|---:| +| `find . -iregex '.*[0-9]\.jpg$'` | 506.0 ± 8.1 | 495.4…518.6 | +| `find . -iname '*[0-9].jpg'` | 304.9 ± 3.1 | 299.8…309.3 | +| `fd -HI '.*[0-9]\.jpg$'` | 66.2 ± 5.8 | 62.5…86.3 | ## Installation diff --git a/src/hyperfine/export/markdown.rs b/src/hyperfine/export/markdown.rs index b5fa2eca8..6948bdfe8 100644 --- a/src/hyperfine/export/markdown.rs +++ b/src/hyperfine/export/markdown.rs @@ -21,14 +21,14 @@ impl Exporter for MarkdownExporter { } fn start_table() -> Vec { - "| Benchmark | Mean [ms] | Min. [ms] | Max. [ms] |\n|----|----|----|----|\n" + "| Command | Mean [ms] | Min…Max [ms] |\n|:---|---:|---:|\n" .bytes() .collect() } fn add_table_row(dest: &mut Vec, entry: &BenchmarkResult) { dest.extend( format!( - "| `{}` | {:.1} ± {:.1} | {:.1} | {:.1} |\n", + "| `{}` | {:.1} ± {:.1} | {:.1}…{:.1} |\n", entry.command.replace("|", "\\|"), entry.mean * MULTIPLIER, entry.stddev * MULTIPLIER,