Commit Graph
122 Commits
Author SHA1 Message Date
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 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 30c381fe2a Flat directory/module structure 2021-08-24 22:44:08 +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
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
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 46ad9bf39a Show error if numeric arguments can not be parsed
Shows an error message if the argument to options like '--warmup <N>'
can not be parsed:

    > hyperfine --warmup xxx "sleep 1"
    Error: Could not read numeric argument to '--warmup': invalid digit found in string

closes #337
2020-10-16 23:55:14 +02:00
sharkdp b2a246c195 Fix nan/inf output for very fast commands
closes #319
2020-10-16 11:00:49 +02:00
Stéphane Campinas 25f8129212 return an error if there are more name options than commands 2020-10-15 22:42:44 +02:00
Stéphane Campinas 0f0a109ca0 add CLI option to identify a command with a custom name
CLI option `--name` can be used to define the name to identify a
command. If not passed, then the command itself is used. Commands
and names are paired in the same order: The first command executed gets
the first name passed as option.

Close #326
2020-10-15 22:42:44 +02:00
sharkdp daf5ced498 Keep output colorized for 'full' and 'color' style
fixes #332
2020-10-15 21:54:57 +02:00
William Chargin f6464a2943 Support matrices of independent parameter lists
This patch permits the `-L`/`--parameter-list` argument to appear
multiple times. Each additional parameter increases the dimensionality
of the parameter matrix. One benchmark will be run for each combination
of parameters (i.e., the benchmark space is the Cartesian product of the
parameter spaces).

For now, `--parameter-list` and `--parameter-scan` are still mutually
exclusive. If desired, a follow-up change could similarly permit
multiple occurrences of `--parameter-scan` and also permit use of both
listed and scanned parameters together. (After all, `--parameter-scan`
can be thought of as syntactic sugar for a parameter list.)

This implementation is a little profligate with memory usage for
`BenchmarkResult`s: each result contains a separate copy of all
parameter names (as `String`s). This could be done away with by
threading lifetimes through the `BenchmarkResult`s, or by ref-counting
the names.

Because `BenchmarkResult`s now have maps with arbitrary key sets, we can
no longer use `serde` to serialize them to CSV. But a CSV writer is easy
to write by hand, so we just do that.

Fixes #253.

Test Plan:
Some unit tests included. As an integration test, try:

```
cargo run --release -- --runs 10 \
    -L foo foo1,foo2 -L bar bar9,bar8 \
    'echo {foo} {bar}' \
    'printf "%s\n" {foo} {bar}' \
    --export-csv /tmp/out
```

with all the export formats.

wchargin-branch: param-list-matrix
wchargin-source: 11051ab222c9de0fbc6ac6a080fbca48e05996c2
2020-10-13 14:00:46 +02:00
Andrii Radyk 9a064b7a8f remove deprecated Error::description 2019-12-19 21:55:16 +01:00
sharkdp 3e217f4233 Add simple tokenizer for parameter list 2019-10-20 13:45:41 +02:00
sharkdp d7dc232e2f Use 'enum' to represent numeric/textual parameter values 2019-10-20 13:45:41 +02:00
Hasan Ibraheem 4a5d08ddc2 Implement basic --parameter-list with naive list parsing 2019-10-20 13:45:41 +02:00
knidarkness 34eb150fef updates as requested in the review 2019-10-15 17:49:48 +02:00
knidarkness 5bc94416ad Fixed error with borrowing 2019-10-15 17:49:48 +02:00
knidarkness 5bdfdbf1cb Added 'none' as a possible value for "style" option
This commit allows to remove all non-errornous output of the tool.
2019-10-15 17:49:48 +02:00
sharkdp 33591d1433 Update error message 2019-10-13 15:11:39 +02:00
Saurav Sharma d1cd30b2a3 refactor code
Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
2019-10-13 15:11:39 +02:00
Saurav Sharma bc82bd5f23 raise error if preparation_command length is not equal to command or 1
Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
2019-10-13 15:11:39 +02:00
Saurav Sharma 0c0713da30 Add multiple --prepare support
Signed-off-by: Saurav Sharma <appdroiddeveloper@gmail.com>
2019-10-13 15:11:39 +02:00
Piyush Rungta b10b93f473 Add support for floats in --parameter-scan 2019-09-01 14:31:35 +02:00
Piyush Rungta 737403df35 Run cargo fmt 2019-09-01 14:31:35 +02:00
Piyush Rungta 3e3f4d9a26 Add argument to take parameter range step size 2019-08-24 08:56:59 +02:00
philipp 16210a1d13 Pass Copyable enums by value 2019-07-17 21:11:44 +02:00
philipp c0ada7d044 Use slices instead of borrowed vectors 2019-07-17 21:11:44 +02:00
philipp f3f8c9ca98 Avoid redundant ref 2019-07-17 21:11:44 +02:00
philipp 5849446315 Avoid long literal without separator 2019-07-17 21:11:44 +02:00
philipp cfd298ef14 Avoid redundant return 2019-07-17 21:11:44 +02:00
philipp 3f79985473 Factor common operations into closure 2019-07-17 21:11:44 +02:00
philipp a5ce659b9c Avoid closure 2019-07-17 21:11:44 +02:00
philipp b573617a7c Return value directly 2019-07-17 21:11:44 +02:00
sharkdp e09707c90f Extract computation of relative speed 2019-06-08 12:29:28 +02:00
Andrii Radyk 2d0b0488f2 convert to rust edition 2018 2019-05-08 08:10:02 -05:00
philipp fdc92cb204 Reduce repetition 2019-02-25 07:04:40 +01:00
Chloe Kudryavtsev e31dc91151 Add Asciidoc export option
Signed-off-by: Chloe Kudryavtsev <toast@toastin.space>
2019-01-30 21:27:25 +01:00