Commit Graph
94 Commits
Author SHA1 Message Date
David Peter 9b328ff354 Move BenchmarkResult to new file 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 538dd06c16 Makes --comand-name take arguments from --parameter-list. 2021-07-27 22:34:38 +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
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
Julian Kaindl c05d7f9480 Add command exit code to output if it fails 2020-10-25 19:04:17 +01: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 674b5422ab Fix outlier detection for "fast outliers"
closes #329
2020-10-15 22:37:54 +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
sharkdp 46e7e4152a Initial support for randomized environment variables 2020-05-25 16:03:58 +02: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 538691e999 Use String instead of NumericType for paramater in Command 2019-10-20 13:45:41 +02:00
knidarkness b3084cbb58 update output condition check to use .map 2019-10-15 17:49:48 +02:00
knidarkness 34eb150fef updates as requested in the review 2019-10-15 17:49:48 +02:00
knidarkness 08ad79a729 Removed output for warnings 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
Stefan Seemayer 6a8dd1962c Also run prepare command during warmup
Fixes #182
2019-10-14 22:12:31 +02:00
sharkdp 92e59c37c1 Use 'if' instead of 'match' 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
philipp 16210a1d13 Pass Copyable enums by value 2019-07-17 21:11:44 +02:00
philipp a0bd0248ce Avoid redundant explicit borrow 2019-07-17 21:11:44 +02:00
sharkdp fb7ded6ebc Add median run time to CSV and JSON export formats 2019-06-08 13:55:50 +02:00
Andrii Radyk 2d0b0488f2 convert to rust edition 2018 2019-05-08 08:10:02 -05:00
Atul Bhosale 1317092c9e Format code using 'cargo fmt' 2019-04-04 20:41:25 +02:00
Benjamin Bannier b252531bde Serialize command parameters to data output files
This patch adds any parameter used to data output files (currently JSON
and CSV files). With that users have direct access to both input values
(i.e., benchmark parameters) and the resulting timings which should
simplify follow-up analyses.
2019-01-18 07:45:32 +01:00
Colin Wahl 5af43cfc7b add cleanup command which is executed at the end of each benchmark 2019-01-14 20:21:50 +01:00
sharkdp 51fe31e7d2 Improve progress bar 'experience' 2018-12-12 19:45:15 +01:00
tcmal 048506bed4 Show (dimmed) # of runs along with range.
Fixes #78
2018-12-05 14:43:29 +01:00
sharkdp a4cf1eaa29 Format source code 2018-11-21 19:55:58 +01:00
Jason Peacock 3aa26a3e27 Moved types::Second and types::Unit to new unit module
Also review feedback.
2018-11-04 10:15:05 +01:00
Jason Peacock f0b6f130ea Add option to set time units for CLI & Markdown, closes #80
Add option to set the time units to either `MilliSecond` or `Second`
for both CLI output and Markdown export, overriding the default logic.
2018-11-04 10:15:05 +01:00
Jason Peacock 01581f60e0 Add option to set the shell, closes #61
Allow the user to set the shell used for executing benchmark commands.

The option (-S/--shell) can be overridden, when there are duplicate
options the last option's value will be used.
2018-10-31 18:02:37 +01:00
Jason Peacock 3246ec27e1 Compact output, add -s color option, closes #70
Strip the empty lines within the results for each benchmark, but keep
the empty line between each benchmark, and before the summary.

Add `color` style option to show color but not be interactive (no
progress bar).
2018-09-28 21:57:53 +02:00
sharkdp f85e61dc39 cargo fmt 2018-09-27 23:07:24 +02:00
Diogo Sousa 0466a1d7cf Addressed review comments. 2018-09-09 23:18:18 +02:00
Diogo Sousa d78c33b864 Added options to specify the max/exact numbers of runs.
Fixes #77.
2018-09-09 23:18:18 +02:00
Tuomas Siipola 5ccf1a4d61 Support Rust 1.20.0 2018-07-05 19:12:41 +02:00
Tuomas Siipola fb9b30c7f8 Support parameter in preparation command 2018-07-05 19:12:41 +02:00