Commit Graph
546 Commits
Author SHA1 Message Date
David Peter 81b737fdc1 Remove BenchmarkResult::new 2022-02-06 20:19:50 +01:00
David Peter ce7087b107 Use thiserror for to derive Error 2022-02-06 20:19:50 +01:00
David Peter f5de5487cc Fix clippy suggestions 2022-02-06 17:47:40 +01:00
David Peter 80a9f51710 Update to clap 3 2022-02-03 21:07:15 +01:00
Karl Heinz Marbaise 272b107684 Fixed #452 - Difference between markdown and asciidoctor output 2021-12-03 09:11:49 +01:00
Ævar Arnfjörð Bjarmason 017d55a4a1 Add --setup (-s) option, like --prepare but runs once per batch
Add a --setup option for the use-case of wanting to do one-off setup
before a set of benchmarks, not the once-per-test setup that --prepare
does. This is useful for the cases noted in the updated documentation.

Per the feedback on https://github.com/sharkdp/hyperfine/pull/448 this
new "--setup" option will steal the "-s" short option from
"--style" (initially this was called "--build" and used the
non-conflicting "-b").

Potential future work:

I'd prefer if this and --cleanup took N number of commands, so you
could do e.g.:

    hyperfine -L rev master,next \
        -b 'git worktree add /tmp/test-{r}'  \
        -b 'make -C /tmp/test-{r} all'  \
	'make -C /tmp/test-{r} test' \
	-c 'git worktree remove /tmp/test-{r}'

I.e. a shortcut around not providing these with &&, which makes things
a bit more readable.

But the --cleanup option doesn't do that, so let's just go with what
it's doing for consistency, so for this you'll now need to do:

    hyperfine -L rev master,next \
        -b 'git worktree add /tmp/test-{r} &&
	    make -C /tmp/test-{r} all'  \
	'make -C /tmp/test-{r} test' \
	-c 'git worktree remove /tmp/test-{r}'
2021-11-16 21:36:35 +01:00
David Peter abd0d335ab Make stddev fields optional, hide "± σ" for 1 run 2021-11-14 10:28:24 +01:00
Ævar Arnfjörð Bjarmason bffd476128 Add support for one run with --runs=1
Extend the --runs=N option added in d78c33b (Added options to specify
the max/exact numbers of runs., 2018-09-09) to support --runs=1
instead of dying with a usage error.

This is useful to do ad-hoc testing of your commands while they might
still have syntax errors, or just for doing one run where you don't
care about the stddev.

Before:

    $ /usr/bin/hyperfine -s basic -r 1 -L n 5,10 'sleep 0.{n}'
    Error: Number of runs below two

After (-s basic) also works:

    $ hyperfine -r 1 -L n 5,10 'sleep 0.{n}'
    Benchmark 1: sleep 0.5
      Time (abs ≡):        500.6 ms               [User: 0.6 ms, System: 0.0 ms]

    Benchmark 2: sleep 0.10
      Time (abs ≡):        100.8 ms               [User: 0.7 ms, System: 0.0 ms]

    Summary
      'sleep 0.10' ran
        4.97 ± 0.00 times faster than 'sleep 0.5'

This likewise combines correctly with -m and -M, probably not very
useful, but if you're tweaking an existing command-line:

    $ hyperfine -m 1 -M 1 -L n 5,10 'sleep 0.{n}'
    Benchmark 1: sleep 0.5
      Time (abs ≡):        500.6 ms               [User: 0.5 ms, System: 0.0 ms]

    Benchmark 2: sleep 0.10
      Time (abs ≡):        100.6 ms               [User: 0.6 ms, System: 0.0 ms]

    Summary
      'sleep 0.10' ran
        4.98 ± 0.00 times faster than 'sleep 0.5'

The "± 0.00" output in "faster than" should probably be adjusted too,
or we could keep it for consistency. I didn't implement that because
this is the first time I do anything in Rust, and I ran out of
template to copy when wanting to quickly implement this in
write_benchmark_comparison() in main.rs.
2021-11-14 10:28:24 +01:00
David Peter 58d3eada61 Enable colors on Windows, closes #427 2021-10-17 18:03:18 +02:00
Clément Joly 5c6b302591 Document different increase pattern for -P
Document values of `-P` increasing as powers of 2 and following other
patterns.

Fixes #403
2021-10-17 17:24:32 +02:00
David Peter 8a4e791025 Fix merge conflict 2021-10-17 17:10:46 +02:00
Heikki Hellgren f592155db7 Fix clippy warnings from tests 2021-10-17 17:04:46 +02:00
rhysd f2bfedd3a6 Fix clippy warnings 2021-10-17 17:03:36 +02:00
rhysd 1b7d139f21 Add tests for options::Shell 2021-10-17 17:03:36 +02:00
rhysd e2fdaceb9f Parse --shell option value as shell command 2021-10-17 17:03:36 +02:00
David Peter 1027940e3a Completely remove internal.rs 2021-08-24 22:44:08 +02:00
David Peter 76dd9d40f0 Move relative-speed computation to separate module 2021-08-24 22:44:08 +02:00
David Peter d5a2590b98 Move benchmark comparison to main.rs 2021-08-24 22:44:08 +02:00
David Peter eb31e0f5f9 Move tokenize to new file 2021-08-24 22:44:08 +02:00
David Peter 13986b17f4 Move progress bar to separate module 2021-08-24 22:44:08 +02:00
David Peter 8618c86421 Fix float eq check 2021-08-24 22:44:08 +02:00
David Peter 9d61130b44 Remove timer/internal.rs 2021-08-24 22:44:08 +02:00
David Peter 60e9771ad5 Remove cfg-if dependency 2021-08-24 22:44:08 +02:00
David Peter 9df6174bc2 Re-order imports 2021-08-24 22:44:08 +02:00
David Peter 30c381fe2a Flat directory/module structure 2021-08-24 22:44:08 +02:00
David Peter 9b328ff354 Move BenchmarkResult to new file 2021-08-23 21:47:58 +02:00
David Peter cbfd9f5b41 Move DEFAULT_SHELL to options 2021-08-23 21:47:58 +02:00
David Peter 465160b9aa Move Options struct to new module 2021-08-23 21:47:58 +02:00
David Peter eee32308b7 Move Command struct to new module 2021-08-23 21:47:58 +02:00
David Peter 068bebb4e6 Fix remaining clippy warnings 2021-08-22 16:33:43 +02:00
David Peter 85730b3f0f Auto-fix clippy warnings 2021-08-22 16:33:43 +02:00
David Peter f860c3cf6b Run cargo fmt 2021-08-22 15:51:28 +02:00
David Peter b2ea743adf Reduce shell-startup-time measurements to 50
closes #378
2021-07-27 22:45:26 +02:00
Steven Gu 28e8c315dc Merges new and validate methods of RangeStep into one method, renames error names according to code review. 2021-07-27 22:34:38 +02:00
Steven Gu d4a0e9afb6 Fixes to limit --command-name count appear exactly once or same count with parameters. 2021-07-27 22:34:38 +02:00
Steven Gu 538dd06c16 Makes --comand-name take arguments from --parameter-list. 2021-07-27 22:34:38 +02:00
David Peter de59bb5ff1 Fix clippy errors 2021-07-27 09:26:49 +02:00
Garrett Thornburg 297dddb70e Require user and system time units to match report time unit
The stddev/mean/max/min time unit gives precedence to the `--time-unit`
command line flag and falls back to parsing. This changes the user and
system time to follow the same time unit as the rest of the report.

Closes #408
2021-07-26 21:08:49 +02:00
Rémi Lauzier 5223afc4f1 Revert some change for i686 build 2021-06-14 16:32:58 +02:00
Rémi Lauzier aa162cd886 Fix some clippy warning 2021-06-14 16:32:58 +02:00
Jordi Chauzi 7e23087b89 Avoid confusion between exit code and signal values 2021-05-10 14:55:04 +02:00
Jordi Chauzi 5564407a97 Store exit codes as Options (and remove unwrapping) 2021-05-10 14:55:04 +02:00
Jordi Chauzi 3fcc6a187b Export exit codes to JSON output 2021-05-10 14:55:04 +02:00
David Peter 9e57bf613c Bump indicativ to 0.16 2021-05-09 14:46:37 +02:00
Nir Soffer 5348ab9ba3 benchmark.rs: Don't use # in benchmark name
Using `Benchmark #1` causes github and gitlab to interrupt hyperfine
results as link to issue #1. Remove the # from the benchmark number to
play better with these systems.

Fixes #381.
2021-05-07 10:12:10 +02:00
n4to4 db45181c88 Fix comment 2021-04-23 12:08:56 +02:00
Julian Kaindl c05d7f9480 Add command exit code to output if it fails 2020-10-25 19:04:17 +01:00
Martin Junghanns 990ed45c3a Create export file before first benchmark (#340) 2020-10-18 09:15:44 +02:00
Martin Junghanns d7e6fa6dfb Export intermediate results after each benchmark command 2020-10-18 09:13:56 +02:00
sharkdp 4fa16852cf Update help text 2020-10-17 00:07:06 +02:00