mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-12-03 13:20:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fa16852cf | ||
|
|
e947a62ce2 | ||
|
|
118baa90c9 | ||
|
|
46ad9bf39a | ||
|
|
f67763fd34 | ||
|
|
699d8ca329 | ||
|
|
b2a246c195 |
No files matched your search
+17
-12
@@ -1,6 +1,5 @@
|
|||||||
language: rust
|
language: rust
|
||||||
cache: cargo
|
jobs:
|
||||||
matrix:
|
|
||||||
include:
|
include:
|
||||||
# Stable channel.
|
# Stable channel.
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -18,6 +17,17 @@ matrix:
|
|||||||
- os: osx
|
- os: osx
|
||||||
rust: stable
|
rust: stable
|
||||||
env: TARGET=x86_64-apple-darwin
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env:
|
||||||
|
- TARGET=arm-unknown-linux-gnueabihf
|
||||||
|
- CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8
|
||||||
|
- CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
|
||||||
|
- os: linux
|
||||||
|
rust: stable
|
||||||
|
env:
|
||||||
|
- TARGET=arm-unknown-linux-musleabihf
|
||||||
|
- CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
|
||||||
|
|
||||||
# Minimum Rust supported channel.
|
# Minimum Rust supported channel.
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -36,13 +46,8 @@ matrix:
|
|||||||
rust: 1.43.0
|
rust: 1.43.0
|
||||||
env: TARGET=x86_64-apple-darwin
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
|
||||||
addons:
|
before_install:
|
||||||
apt:
|
- ci/before_install.bash
|
||||||
packages:
|
|
||||||
# needed for i686-unknown-linux-gnu target
|
|
||||||
- gcc-multilib
|
|
||||||
# needed to build deb packages
|
|
||||||
- fakeroot
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
@@ -59,19 +64,19 @@ install:
|
|||||||
script:
|
script:
|
||||||
# Incorporate TARGET env var to the build and test process
|
# Incorporate TARGET env var to the build and test process
|
||||||
- cargo build --target $TARGET --verbose
|
- cargo build --target $TARGET --verbose
|
||||||
- cargo test --target $TARGET --verbose
|
- '[[ $TARGET == arm-unknown-linux-* ]] || cargo test --target $TARGET --verbose'
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- bash ci/before_deploy.bash
|
- bash ci/before_deploy.bash
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
# NOTE updating the `api_key.secure`
|
# NOTE updating the `token.secure`
|
||||||
# - go to: https://github.com/settings/tokens/new
|
# - go to: https://github.com/settings/tokens/new
|
||||||
# - generate new token using `public_repo` scope
|
# - generate new token using `public_repo` scope
|
||||||
# - encrypt it using: `travis encrypt API_KEY_HERE`
|
# - encrypt it using: `travis encrypt API_KEY_HERE`
|
||||||
# - paste the output below
|
# - paste the output below
|
||||||
api_key:
|
token:
|
||||||
secure: "U9QfCOQkeozaDNrTV6i2vRocX2puB5p1WSN+w9t/1j33rAtXx6ZhFx67A8nl0+dQ9nvPu/RIsFWXrYzfHQskL1WulKNHm0S5otN+747dEzbSIfMNi1UfysyCiM1SNPq+FX3qOkva83+Fe2Lyd1g4gQObceE4xsgfplfzdm+ebIa6CrfKOypToEuetzP/r8V0WpW4Cp8ojQwvsL1nfHjr1gmvmr443Gr9Yvgq9SS/NAHldrpaJr8mD26W/7jbHdm3lvrNwqLbthYDUTPZsO+2B44h+T/tuhVYbur4fel1KMo4mkIwZwsSKvJbf3Q6Vdcc9dZM+niZU78UGLt0JNEMQNqQLPGYqh+TlFR2B++lcYlybT3LcUaSkt0YIX7C4DAbMLS6sl5Fq2pRNuM/eY2BWdHf0I+K19PDxUEliUifsfSQ3rbfl52aKKLcJa0WPyDJt0qldElagxOaTIk/jn1kKkdkQu9M4gVzKXImIauRQih3CLER7th8ADMxW5Plgq8fvffJBTKlubUznKrGeeR3Mjm8DsRjhkIvFO0Doqmki4sd5zE/BOFI5a/SHg73ms+bLXLuKFK+YzIlHszCHolzkAT44aq7+LEudk8jt+QVtBEocCN/4ew4Q9Qh2tcn22+hU3Aw88lO95PsbZzTzoFtX4X89Sl1fGtpkHFZvvL4ZT0="
|
secure: "U9QfCOQkeozaDNrTV6i2vRocX2puB5p1WSN+w9t/1j33rAtXx6ZhFx67A8nl0+dQ9nvPu/RIsFWXrYzfHQskL1WulKNHm0S5otN+747dEzbSIfMNi1UfysyCiM1SNPq+FX3qOkva83+Fe2Lyd1g4gQObceE4xsgfplfzdm+ebIa6CrfKOypToEuetzP/r8V0WpW4Cp8ojQwvsL1nfHjr1gmvmr443Gr9Yvgq9SS/NAHldrpaJr8mD26W/7jbHdm3lvrNwqLbthYDUTPZsO+2B44h+T/tuhVYbur4fel1KMo4mkIwZwsSKvJbf3Q6Vdcc9dZM+niZU78UGLt0JNEMQNqQLPGYqh+TlFR2B++lcYlybT3LcUaSkt0YIX7C4DAbMLS6sl5Fq2pRNuM/eY2BWdHf0I+K19PDxUEliUifsfSQ3rbfl52aKKLcJa0WPyDJt0qldElagxOaTIk/jn1kKkdkQu9M4gVzKXImIauRQih3CLER7th8ADMxW5Plgq8fvffJBTKlubUznKrGeeR3Mjm8DsRjhkIvFO0Doqmki4sd5zE/BOFI5a/SHg73ms+bLXLuKFK+YzIlHszCHolzkAT44aq7+LEudk8jt+QVtBEocCN/4ew4Q9Qh2tcn22+hU3Aw88lO95PsbZzTzoFtX4X89Sl1fGtpkHFZvvL4ZT0="
|
||||||
# for uploading multiple files
|
# for uploading multiple files
|
||||||
file_glob: true
|
file_glob: true
|
||||||
|
|||||||
+25
-6
@@ -2,7 +2,22 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- The `-L`/`--parameter-list` option can now be specified multiple times to evaluate all possible combinations of the listed parameters:
|
## Changes
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
## Other
|
||||||
|
|
||||||
|
## Packaging
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# v1.11.0
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- The `-L`/`--parameter-list` option can now be specified multiple times to
|
||||||
|
evaluate all possible combinations of the listed parameters:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
hyperfine -L number 1,2 -L letter a,b,c \
|
hyperfine -L number 1,2 -L letter a,b,c \
|
||||||
@@ -18,16 +33,20 @@
|
|||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
- When parameters are used with `--parameter-list` or `--parameter-scan`, the JSON export format now contains a dictionary `parameters` instead of a single key `parameter`. See #253, #318.
|
- When parameters are used with `--parameter-list` or `--parameter-scan`, the JSON export format
|
||||||
- The `plot_parametrized.py` script now infers the parameter name, and its `--parameter-name` argument has been deprecated. See #253, #318.
|
now contains a dictionary `parameters` instead of a single key `parameter`. See #253, #318.
|
||||||
|
- The `plot_parametrized.py` script now infers the parameter name, and its `--parameter-name`
|
||||||
|
argument has been deprecated. See #253, #318.
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
|
||||||
- Fix a bug in the outlier detection which would only detect "slow outliers" but not the fast ones (runs that are much faster than the rest of the benchmarking runs), see #329
|
- Fix a bug in the outlier detection which would only detect "slow outliers" but not the fast
|
||||||
|
ones (runs that are much faster than the rest of the benchmarking runs), see #329
|
||||||
|
- Better error messages for very fast commands that would lead to inf/nan results in the relative
|
||||||
|
speed comparison, see #319
|
||||||
|
- Show error message if `--warmup` or `--*runs` arguments can not be parsed, see #337
|
||||||
- Keep output colorized when the output is not interactive and `--style=full` or `--style=color` is used.
|
- Keep output colorized when the output is not interactive and `--style=full` or `--style=color` is used.
|
||||||
|
|
||||||
## Other
|
|
||||||
## Packaging
|
|
||||||
|
|
||||||
# v1.10.0
|
# v1.10.0
|
||||||
|
|
||||||
|
|||||||
Generated
+53
-53
@@ -37,9 +37,9 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
@@ -109,9 +109,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console"
|
name = "console"
|
||||||
version = "0.11.3"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8c0994e656bba7b922d8dd1245db90672ffb701e684e45be58f20719d69abc5a"
|
checksum = "c0b1aacfaffdbff75be81c15a399b4bedf78aaefe840e8af1d299ac2ade885d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"encode_unicode",
|
"encode_unicode",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@@ -160,9 +160,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.1.14"
|
version = "0.1.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
|
checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -171,16 +171,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.13"
|
version = "0.1.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
|
checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyperfine"
|
name = "hyperfine"
|
||||||
version = "1.10.0"
|
version = "1.11.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"approx",
|
"approx",
|
||||||
"atty",
|
"atty",
|
||||||
@@ -213,9 +213,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "0.4.5"
|
version = "0.4.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e"
|
checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
@@ -225,9 +225,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.77"
|
version = "0.2.79"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
|
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
@@ -255,7 +255,7 @@ version = "0.2.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304"
|
checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
@@ -266,27 +266,27 @@ version = "0.2.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95"
|
checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
version = "0.1.42"
|
version = "0.1.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
|
checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-iter"
|
name = "num-iter"
|
||||||
version = "0.1.40"
|
version = "0.1.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00"
|
checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
@@ -297,7 +297,7 @@ version = "0.2.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"
|
checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@@ -305,11 +305,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.11"
|
version = "0.2.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
|
checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg 1.0.0",
|
"autocfg 1.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -320,24 +320,24 @@ checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.8"
|
version = "0.2.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea"
|
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.17"
|
version = "1.0.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1502d12e458c49a4c9cbff560d0fe0060c252bc29799ed94ca2ed4bb665a0101"
|
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.6"
|
version = "1.0.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea"
|
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -500,9 +500,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.3.7"
|
version = "1.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692"
|
checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex-syntax",
|
"regex-syntax",
|
||||||
]
|
]
|
||||||
@@ -518,9 +518,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.17"
|
version = "0.6.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
|
checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rust_decimal"
|
name = "rust_decimal"
|
||||||
@@ -534,24 +534,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.4"
|
version = "1.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1"
|
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.116"
|
version = "1.0.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
|
checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.116"
|
version = "1.0.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
|
checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -560,9 +560,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.58"
|
version = "1.0.59"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4"
|
checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -587,9 +587,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.33"
|
version = "1.0.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd"
|
checksum = "e03e57e4fcbfe7749842d53e24ccb9aa12b7252dbe5e91d2acad31834c8b8fdd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -608,9 +608,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "terminal_size"
|
name = "terminal_size"
|
||||||
version = "0.1.12"
|
version = "0.1.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8038f95fc7a6f351163f4b964af631bd26c9e828f7db085f2a84aca56f70d13b"
|
checksum = "9a14cd9f8c72704232f0bfc8455c0e861f0ad4eb60cc9ec8a170e231414c1e13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
"winapi",
|
||||||
@@ -618,9 +618,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termios"
|
name = "termios"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6f0fcee7b24a25675de40d5bb4de6e41b0df07bc9856295e7e2b3a3600c400c2"
|
checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -637,15 +637,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
|
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vec_map"
|
name = "vec_map"
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ license = "MIT/Apache-2.0"
|
|||||||
name = "hyperfine"
|
name = "hyperfine"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/sharkdp/hyperfine"
|
repository = "https://github.com/sharkdp/hyperfine"
|
||||||
version = "1.10.0"
|
version = "1.11.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ The JSON output is useful if you want to analyze the benchmark results in more d
|
|||||||
Download the appropriate `.deb` package from the [Release page](https://github.com/sharkdp/hyperfine/releases)
|
Download the appropriate `.deb` package from the [Release page](https://github.com/sharkdp/hyperfine/releases)
|
||||||
and install it via `dpkg`:
|
and install it via `dpkg`:
|
||||||
```
|
```
|
||||||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.10.0/hyperfine_1.10.0_amd64.deb
|
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
|
||||||
sudo dpkg -i hyperfine_1.10.0_amd64.deb
|
sudo dpkg -i hyperfine_1.11.0_amd64.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Fedora
|
### On Fedora
|
||||||
@@ -191,7 +191,7 @@ Download the corresponding archive from the [Release page](https://github.com/sh
|
|||||||
## Alternative tools
|
## Alternative tools
|
||||||
|
|
||||||
Hyperfine is inspired by [bench](https://github.com/Gabriel439/bench).
|
Hyperfine is inspired by [bench](https://github.com/Gabriel439/bench).
|
||||||
|
|
||||||
## Integration with other tools
|
## Integration with other tools
|
||||||
|
|
||||||
[Chronologer](https://github.com/dandavison/chronologer) is a tool that uses `hyperfine` to
|
[Chronologer](https://github.com/dandavison/chronologer) is a tool that uses `hyperfine` to
|
||||||
|
|||||||
Vendored
+64
-6
@@ -11,17 +11,25 @@ pack() {
|
|||||||
local tempdir
|
local tempdir
|
||||||
local out_dir
|
local out_dir
|
||||||
local package_name
|
local package_name
|
||||||
|
local gcc_prefix
|
||||||
|
|
||||||
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
||||||
out_dir=$(pwd)
|
out_dir=$(pwd)
|
||||||
package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
|
package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
|
||||||
|
|
||||||
|
if [[ $TARGET == arm-unknown-linux-* ]]; then
|
||||||
|
gcc_prefix="arm-linux-gnueabihf-"
|
||||||
|
else
|
||||||
|
gcc_prefix=""
|
||||||
|
fi
|
||||||
|
|
||||||
# create a "staging" directory
|
# create a "staging" directory
|
||||||
mkdir "$tempdir/$package_name"
|
mkdir "$tempdir/$package_name"
|
||||||
|
mkdir "$tempdir/$package_name/autocomplete"
|
||||||
|
|
||||||
# copying the main binary
|
# copying the main binary
|
||||||
cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
|
cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
|
||||||
strip "$tempdir/$package_name/$PROJECT_NAME"
|
"${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
|
||||||
|
|
||||||
# manpage, readme and license
|
# manpage, readme and license
|
||||||
cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"
|
cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"
|
||||||
@@ -30,7 +38,6 @@ pack() {
|
|||||||
cp LICENSE-APACHE "$tempdir/$package_name"
|
cp LICENSE-APACHE "$tempdir/$package_name"
|
||||||
|
|
||||||
# various autocomplete
|
# various autocomplete
|
||||||
mkdir "$tempdir/$package_name/autocomplete"
|
|
||||||
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"
|
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"
|
||||||
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"
|
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"
|
||||||
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
|
cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
|
||||||
@@ -48,17 +55,29 @@ make_deb() {
|
|||||||
local version
|
local version
|
||||||
local dpkgname
|
local dpkgname
|
||||||
local conflictname
|
local conflictname
|
||||||
|
local homepage
|
||||||
|
local maintainer
|
||||||
|
local gcc_prefix
|
||||||
|
|
||||||
|
homepage="https://github.com/sharkdp/$PROJECT_NAME"
|
||||||
|
maintainer="David Peter <mail@david-peter.de>"
|
||||||
|
|
||||||
case $TARGET in
|
case $TARGET in
|
||||||
x86_64*)
|
x86_64*)
|
||||||
architecture=amd64
|
architecture=amd64
|
||||||
|
gcc_prefix=""
|
||||||
;;
|
;;
|
||||||
i686*)
|
i686*)
|
||||||
architecture=i386
|
architecture=i386
|
||||||
|
gcc_prefix=""
|
||||||
|
;;
|
||||||
|
arm*hf)
|
||||||
|
architecture=armhf
|
||||||
|
gcc_prefix="arm-linux-gnueabihf-"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "ERROR: unknown target" >&2
|
echo "make_deb: skipping target '${TARGET}'" >&2
|
||||||
return 1
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
version=${TRAVIS_TAG#v}
|
version=${TRAVIS_TAG#v}
|
||||||
@@ -74,7 +93,7 @@ make_deb() {
|
|||||||
|
|
||||||
# copy the main binary
|
# copy the main binary
|
||||||
install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
|
install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
|
||||||
strip "$tempdir/usr/bin/$PROJECT_NAME"
|
"${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
|
||||||
|
|
||||||
# manpage
|
# manpage
|
||||||
install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
|
install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
|
||||||
@@ -84,6 +103,44 @@ make_deb() {
|
|||||||
install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
|
install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
|
||||||
install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
|
install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
|
||||||
install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
|
install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
|
||||||
|
cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
|
||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: $PROJECT_NAME
|
||||||
|
Source: $homepage
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: $maintainer
|
||||||
|
License: Apache-2.0 or MIT
|
||||||
|
|
||||||
|
License: Apache-2.0
|
||||||
|
On Debian systems, the complete text of the Apache-2.0 can be found in the
|
||||||
|
file /usr/share/common-licenses/Apache-2.0.
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
Permission is hereby granted, free of charge, to any
|
||||||
|
person obtaining a copy of this software and associated
|
||||||
|
documentation files (the "Software"), to deal in the
|
||||||
|
Software without restriction, including without
|
||||||
|
limitation the rights to use, copy, modify, merge,
|
||||||
|
publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software
|
||||||
|
is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
.
|
||||||
|
The above copyright notice and this permission notice
|
||||||
|
shall be included in all copies or substantial portions
|
||||||
|
of the Software.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||||
|
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||||
|
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||||
|
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||||
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
|
EOF
|
||||||
|
|
||||||
# completions
|
# completions
|
||||||
install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.bash "$tempdir/usr/share/bash-completion/completions/${PROJECT_NAME}"
|
install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.bash "$tempdir/usr/share/bash-completion/completions/${PROJECT_NAME}"
|
||||||
@@ -97,10 +154,11 @@ Package: $dpkgname
|
|||||||
Version: $version
|
Version: $version
|
||||||
Section: utils
|
Section: utils
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: David Peter <mail@david-peter.de>
|
Maintainer: $maintainer
|
||||||
Architecture: $architecture
|
Architecture: $architecture
|
||||||
Provides: $PROJECT_NAME
|
Provides: $PROJECT_NAME
|
||||||
Conflicts: $conflictname
|
Conflicts: $conflictname
|
||||||
|
Homepage: $homepage
|
||||||
Description: A command-line benchmarking tool.
|
Description: A command-line benchmarking tool.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
if [ "$TRAVIS_OS_NAME" != linux ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
# needed to build deb packages
|
||||||
|
sudo apt-get install -y fakeroot
|
||||||
|
|
||||||
|
# needed for i686 linux gnu target
|
||||||
|
if [[ $TARGET == i686-unknown-linux-* ]]; then
|
||||||
|
sudo apt-get install -y gcc-multilib
|
||||||
|
fi
|
||||||
|
|
||||||
|
# needed for cross-compiling for arm
|
||||||
|
if [[ $TARGET == arm-unknown-linux-* ]]; then
|
||||||
|
sudo apt-get install -y \
|
||||||
|
gcc-4.8-arm-linux-gnueabihf \
|
||||||
|
binutils-arm-linux-gnueabihf \
|
||||||
|
libc6-armhf-cross \
|
||||||
|
libc6-dev-armhf-cross
|
||||||
|
fi
|
||||||
@@ -143,7 +143,9 @@ fn build_app() -> App<'static, 'static> {
|
|||||||
"Perform benchmark runs for each value in the comma-separated list VALUES. \
|
"Perform benchmark runs for each value in the comma-separated list VALUES. \
|
||||||
Replaces the string '{VAR}' in each command by the current parameter value\
|
Replaces the string '{VAR}' in each command by the current parameter value\
|
||||||
.\n\nExample: hyperfine -L compiler gcc,clang '{compiler} -O2 main.cpp'\n\n\
|
.\n\nExample: hyperfine -L compiler gcc,clang '{compiler} -O2 main.cpp'\n\n\
|
||||||
This performs benchmarks for 'gcc -O2 main.cpp' and 'clang -O2 main.cpp'.",
|
This performs benchmarks for 'gcc -O2 main.cpp' and 'clang -O2 main.cpp'.\n\n\
|
||||||
|
The option can be specified multiple times to run benchmarks for all \
|
||||||
|
possible parameter combinations.\n"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|||||||
+11
-3
@@ -2,6 +2,7 @@ use rust_decimal::Error as DecimalError;
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::num;
|
use std::num;
|
||||||
|
use std::num::ParseIntError;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ParameterScanError {
|
pub enum ParameterScanError {
|
||||||
@@ -46,13 +47,14 @@ impl fmt::Display for ParameterScanError {
|
|||||||
impl Error for ParameterScanError {}
|
impl Error for ParameterScanError {}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum OptionsError {
|
pub enum OptionsError<'a> {
|
||||||
RunsBelowTwo,
|
RunsBelowTwo,
|
||||||
EmptyRunsRange,
|
EmptyRunsRange,
|
||||||
TooManyCommandNames(usize),
|
TooManyCommandNames(usize),
|
||||||
|
NumericParsingError(&'a str, ParseIntError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for OptionsError {
|
impl<'a> fmt::Display for OptionsError<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
OptionsError::EmptyRunsRange => write!(f, "Empty runs range"),
|
OptionsError::EmptyRunsRange => write!(f, "Empty runs range"),
|
||||||
@@ -60,8 +62,14 @@ impl fmt::Display for OptionsError {
|
|||||||
OptionsError::TooManyCommandNames(n) => {
|
OptionsError::TooManyCommandNames(n) => {
|
||||||
write!(f, "Too many --command-name options: expected {} at most", n)
|
write!(f, "Too many --command-name options: expected {} at most", n)
|
||||||
}
|
}
|
||||||
|
OptionsError::NumericParsingError(cmd, ref err) => write!(
|
||||||
|
f,
|
||||||
|
"Could not read numeric argument to '--{cmd}': {err}",
|
||||||
|
cmd = cmd,
|
||||||
|
err = err
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error for OptionsError {}
|
impl<'a> Error for OptionsError<'a> {}
|
||||||
@@ -5,7 +5,7 @@ use crate::hyperfine::internal::{compute_relative_speed, BenchmarkResultWithRela
|
|||||||
use crate::hyperfine::types::BenchmarkResult;
|
use crate::hyperfine::types::BenchmarkResult;
|
||||||
use crate::hyperfine::units::Unit;
|
use crate::hyperfine::units::Unit;
|
||||||
|
|
||||||
use std::io::Result;
|
use std::io::{Error, ErrorKind, Result};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct MarkdownExporter {}
|
pub struct MarkdownExporter {}
|
||||||
@@ -23,15 +23,20 @@ impl Exporter for MarkdownExporter {
|
|||||||
Unit::Second
|
Unit::Second
|
||||||
};
|
};
|
||||||
|
|
||||||
let annotated_results = compute_relative_speed(results);
|
if let Some(annotated_results) = compute_relative_speed(results) {
|
||||||
|
let mut destination = start_table(unit);
|
||||||
|
|
||||||
let mut destination = start_table(unit);
|
for result in annotated_results {
|
||||||
|
add_table_row(&mut destination, &result, unit);
|
||||||
|
}
|
||||||
|
|
||||||
for result in annotated_results {
|
Ok(destination)
|
||||||
add_table_row(&mut destination, &result, unit);
|
} else {
|
||||||
|
Err(Error::new(
|
||||||
|
ErrorKind::Other,
|
||||||
|
"Relative speed comparison is not available for Markdown export.",
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(destination)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+66
-35
@@ -52,6 +52,7 @@ pub fn min(vals: &[f64]) -> f64 {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct BenchmarkResultWithRelativeSpeed<'a> {
|
pub struct BenchmarkResultWithRelativeSpeed<'a> {
|
||||||
pub result: &'a BenchmarkResult,
|
pub result: &'a BenchmarkResult,
|
||||||
pub relative_speed: Scalar,
|
pub relative_speed: Scalar,
|
||||||
@@ -65,31 +66,38 @@ fn compare_mean_time(l: &BenchmarkResult, r: &BenchmarkResult) -> Ordering {
|
|||||||
|
|
||||||
pub fn compute_relative_speed<'a>(
|
pub fn compute_relative_speed<'a>(
|
||||||
results: &'a [BenchmarkResult],
|
results: &'a [BenchmarkResult],
|
||||||
) -> Vec<BenchmarkResultWithRelativeSpeed<'a>> {
|
) -> Option<Vec<BenchmarkResultWithRelativeSpeed<'a>>> {
|
||||||
let fastest: &BenchmarkResult = results
|
let fastest: &BenchmarkResult = results
|
||||||
.iter()
|
.iter()
|
||||||
.min_by(|&l, &r| compare_mean_time(l, r))
|
.min_by(|&l, &r| compare_mean_time(l, r))
|
||||||
.expect("at least one benchmark result");
|
.expect("at least one benchmark result");
|
||||||
|
|
||||||
results
|
if fastest.mean == 0.0 {
|
||||||
.iter()
|
return None;
|
||||||
.map(|result| {
|
}
|
||||||
let ratio = result.mean / fastest.mean;
|
|
||||||
|
|
||||||
// https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulas
|
Some(
|
||||||
// Covariance asssumed to be 0, i.e. variables are assumed to be independent
|
results
|
||||||
let ratio_stddev = ratio
|
.iter()
|
||||||
* ((result.stddev / result.mean).powi(2) + (fastest.stddev / fastest.mean).powi(2))
|
.map(|result| {
|
||||||
|
let ratio = result.mean / fastest.mean;
|
||||||
|
|
||||||
|
// https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulas
|
||||||
|
// Covariance asssumed to be 0, i.e. variables are assumed to be independent
|
||||||
|
let ratio_stddev = ratio
|
||||||
|
* ((result.stddev / result.mean).powi(2)
|
||||||
|
+ (fastest.stddev / fastest.mean).powi(2))
|
||||||
.sqrt();
|
.sqrt();
|
||||||
|
|
||||||
BenchmarkResultWithRelativeSpeed {
|
BenchmarkResultWithRelativeSpeed {
|
||||||
result,
|
result,
|
||||||
relative_speed: ratio,
|
relative_speed: ratio,
|
||||||
relative_speed_stddev: ratio_stddev,
|
relative_speed_stddev: ratio_stddev,
|
||||||
is_fastest: result == fastest,
|
is_fastest: result == fastest,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect()
|
.collect(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_benchmark_comparison(results: &[BenchmarkResult]) {
|
pub fn write_benchmark_comparison(results: &[BenchmarkResult]) {
|
||||||
@@ -97,21 +105,31 @@ pub fn write_benchmark_comparison(results: &[BenchmarkResult]) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut annotated_results = compute_relative_speed(&results);
|
if let Some(mut annotated_results) = compute_relative_speed(&results) {
|
||||||
annotated_results.sort_by(|l, r| compare_mean_time(l.result, r.result));
|
annotated_results.sort_by(|l, r| compare_mean_time(l.result, r.result));
|
||||||
|
|
||||||
let fastest = &annotated_results[0];
|
let fastest = &annotated_results[0];
|
||||||
let others = &annotated_results[1..];
|
let others = &annotated_results[1..];
|
||||||
|
|
||||||
println!("{}", "Summary".bold());
|
println!("{}", "Summary".bold());
|
||||||
println!(" '{}' ran", fastest.result.command.cyan());
|
println!(" '{}' ran", fastest.result.command.cyan());
|
||||||
|
|
||||||
for item in others {
|
for item in others {
|
||||||
println!(
|
println!(
|
||||||
"{} ± {} times faster than '{}'",
|
"{} ± {} times faster than '{}'",
|
||||||
format!("{:8.2}", item.relative_speed).bold().green(),
|
format!("{:8.2}", item.relative_speed).bold().green(),
|
||||||
format!("{:.2}", item.relative_speed_stddev).green(),
|
format!("{:.2}", item.relative_speed_stddev).green(),
|
||||||
&item.result.command.magenta()
|
&item.result.command.magenta()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
eprintln!(
|
||||||
|
"{}: The benchmark comparison could not be computed as some benchmark times are zero. \
|
||||||
|
This could be caused by background interference during the initial calibration phase \
|
||||||
|
of hyperfine, in combination with very fast commands (faster than a few milliseconds). \
|
||||||
|
Try to re-run the benchmark on a quiet system. If it does not help, you command is \
|
||||||
|
most likely too fast to be accurately benchmarked by hyperfine.",
|
||||||
|
"Note".bold().red()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,12 +143,11 @@ fn test_max() {
|
|||||||
assert_eq!(1.0, max(&[-1.0, 1.0, 0.0]));
|
assert_eq!(1.0, max(&[-1.0, 1.0, 0.0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[cfg(test)]
|
||||||
fn test_compute_relative_speed() {
|
fn create_result(name: &str, mean: Scalar) -> BenchmarkResult {
|
||||||
use approx::assert_relative_eq;
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
let create_result = |name: &str, mean| BenchmarkResult {
|
BenchmarkResult {
|
||||||
command: name.into(),
|
command: name.into(),
|
||||||
mean,
|
mean,
|
||||||
stddev: 1.0,
|
stddev: 1.0,
|
||||||
@@ -141,7 +158,12 @@ fn test_compute_relative_speed() {
|
|||||||
max: mean,
|
max: mean,
|
||||||
times: None,
|
times: None,
|
||||||
parameters: BTreeMap::new(),
|
parameters: BTreeMap::new(),
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_compute_relative_speed() {
|
||||||
|
use approx::assert_relative_eq;
|
||||||
|
|
||||||
let results = vec![
|
let results = vec![
|
||||||
create_result("cmd1", 3.0),
|
create_result("cmd1", 3.0),
|
||||||
@@ -149,13 +171,22 @@ fn test_compute_relative_speed() {
|
|||||||
create_result("cmd3", 5.0),
|
create_result("cmd3", 5.0),
|
||||||
];
|
];
|
||||||
|
|
||||||
let annotated_results = compute_relative_speed(&results);
|
let annotated_results = compute_relative_speed(&results).unwrap();
|
||||||
|
|
||||||
assert_relative_eq!(1.5, annotated_results[0].relative_speed);
|
assert_relative_eq!(1.5, annotated_results[0].relative_speed);
|
||||||
assert_relative_eq!(1.0, annotated_results[1].relative_speed);
|
assert_relative_eq!(1.0, annotated_results[1].relative_speed);
|
||||||
assert_relative_eq!(2.5, annotated_results[2].relative_speed);
|
assert_relative_eq!(2.5, annotated_results[2].relative_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_compute_relative_speed_for_zero_times() {
|
||||||
|
let results = vec![create_result("cmd1", 1.0), create_result("cmd2", 0.0)];
|
||||||
|
|
||||||
|
let annotated_results = compute_relative_speed(&results);
|
||||||
|
|
||||||
|
assert!(annotated_results.is_none());
|
||||||
|
}
|
||||||
|
|
||||||
pub fn tokenize<'a>(values: &'a str) -> Vec<String> {
|
pub fn tokenize<'a>(values: &'a str) -> Vec<String> {
|
||||||
let mut tokens = vec![];
|
let mut tokens = vec![];
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
|
|||||||
+34
-25
@@ -16,7 +16,7 @@ use crate::hyperfine::export::{ExportManager, ExportType};
|
|||||||
use crate::hyperfine::internal::{tokenize, write_benchmark_comparison};
|
use crate::hyperfine::internal::{tokenize, write_benchmark_comparison};
|
||||||
use crate::hyperfine::parameter_range::get_parameterized_commands;
|
use crate::hyperfine::parameter_range::get_parameterized_commands;
|
||||||
use crate::hyperfine::types::{
|
use crate::hyperfine::types::{
|
||||||
BenchmarkResult, CmdFailureAction, Command, HyperfineOptions, OutputStyleOption, ParameterValue,
|
CmdFailureAction, Command, HyperfineOptions, OutputStyleOption, ParameterValue,
|
||||||
};
|
};
|
||||||
use crate::hyperfine::units::Unit;
|
use crate::hyperfine::units::Unit;
|
||||||
|
|
||||||
@@ -27,7 +27,11 @@ pub fn error(message: &str) -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Runs the benchmark for the given commands
|
/// Runs the benchmark for the given commands
|
||||||
fn run(commands: &[Command<'_>], options: &HyperfineOptions) -> io::Result<Vec<BenchmarkResult>> {
|
fn run(
|
||||||
|
commands: &[Command<'_>],
|
||||||
|
options: &HyperfineOptions,
|
||||||
|
export_manager: &ExportManager,
|
||||||
|
) -> io::Result<()> {
|
||||||
let shell_spawning_time =
|
let shell_spawning_time =
|
||||||
mean_shell_spawning_time(&options.shell, options.output_style, options.show_output)?;
|
mean_shell_spawning_time(&options.shell, options.output_style, options.show_output)?;
|
||||||
|
|
||||||
@@ -47,7 +51,21 @@ fn run(commands: &[Command<'_>], options: &HyperfineOptions) -> io::Result<Vec<B
|
|||||||
timing_results.push(run_benchmark(num, cmd, shell_spawning_time, options)?);
|
timing_results.push(run_benchmark(num, cmd, shell_spawning_time, options)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(timing_results)
|
// Print relative speed comparison
|
||||||
|
if options.output_style != OutputStyleOption::Disabled {
|
||||||
|
write_benchmark_comparison(&timing_results);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export results
|
||||||
|
let ans = export_manager.write_results(timing_results, options.time_unit);
|
||||||
|
if let Err(e) = ans {
|
||||||
|
error(&format!(
|
||||||
|
"The following error occurred while exporting: {}",
|
||||||
|
e
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -57,45 +75,36 @@ fn main() {
|
|||||||
let commands = build_commands(&matches);
|
let commands = build_commands(&matches);
|
||||||
|
|
||||||
let res = match options {
|
let res = match options {
|
||||||
Ok(ref opts) => run(&commands, &opts),
|
Ok(ref opts) => run(&commands, &opts, &export_manager),
|
||||||
Err(ref e) => error(&e.to_string()),
|
Err(ref e) => error(&e.to_string()),
|
||||||
};
|
};
|
||||||
|
|
||||||
match res {
|
match res {
|
||||||
Ok(timing_results) => {
|
Ok(_) => {}
|
||||||
let options = options.unwrap();
|
|
||||||
|
|
||||||
if options.output_style != OutputStyleOption::Disabled {
|
|
||||||
write_benchmark_comparison(&timing_results);
|
|
||||||
}
|
|
||||||
|
|
||||||
let ans = export_manager.write_results(timing_results, options.time_unit);
|
|
||||||
if let Err(e) = ans {
|
|
||||||
error(&format!(
|
|
||||||
"The following error occurred while exporting: {}",
|
|
||||||
e
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e) => error(&e.to_string()),
|
Err(e) => error(&e.to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build the HyperfineOptions that correspond to the given ArgMatches
|
/// Build the HyperfineOptions that correspond to the given ArgMatches
|
||||||
fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result<HyperfineOptions, OptionsError> {
|
fn build_hyperfine_options<'a>(
|
||||||
|
matches: &ArgMatches<'a>,
|
||||||
|
) -> Result<HyperfineOptions, OptionsError<'a>> {
|
||||||
let mut options = HyperfineOptions::default();
|
let mut options = HyperfineOptions::default();
|
||||||
let param_to_u64 = |param| {
|
let param_to_u64 = |param| {
|
||||||
matches
|
matches
|
||||||
.value_of(param)
|
.value_of(param)
|
||||||
.and_then(|n| u64::from_str_radix(n, 10).ok())
|
.map(|n| {
|
||||||
|
u64::from_str_radix(n, 10).map_err(|e| OptionsError::NumericParsingError(param, e))
|
||||||
|
})
|
||||||
|
.transpose()
|
||||||
};
|
};
|
||||||
|
|
||||||
options.warmup_count = param_to_u64("warmup").unwrap_or(options.warmup_count);
|
options.warmup_count = param_to_u64("warmup")?.unwrap_or(options.warmup_count);
|
||||||
|
|
||||||
let mut min_runs = param_to_u64("min-runs");
|
let mut min_runs = param_to_u64("min-runs")?;
|
||||||
let mut max_runs = param_to_u64("max-runs");
|
let mut max_runs = param_to_u64("max-runs")?;
|
||||||
|
|
||||||
if let Some(runs) = param_to_u64("runs") {
|
if let Some(runs) = param_to_u64("runs")? {
|
||||||
min_runs = Some(runs);
|
min_runs = Some(runs);
|
||||||
max_runs = Some(runs);
|
max_runs = Some(runs);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user