mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-29 19:31:04 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4917c557e4 | ||
|
|
a2d7094282 | ||
|
|
a6c301099b | ||
|
|
88a9150b4c | ||
|
|
094d0121ef | ||
|
|
c974f9b4d9 | ||
|
|
e1fa3ace8d | ||
|
|
0d6ade930a |
No files matched your search
@@ -88,6 +88,22 @@ option:
|
|||||||
hyperfine -L compiler g++,clang++ '{compiler} -O2 main.cpp'
|
hyperfine -L compiler g++,clang++ '{compiler} -O2 main.cpp'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A common use case is comparing the same command across multiple Git branches. Use `--setup`
|
||||||
|
to switch branches once before each set of timing runs, so the branch switch is not part of
|
||||||
|
the measured command:
|
||||||
|
```sh
|
||||||
|
hyperfine \
|
||||||
|
--parameter-list branch main,performance-improvements \
|
||||||
|
--setup 'git switch {branch}' \
|
||||||
|
'python main.py'
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need a unique value for each individual run of a benchmark command, hyperfine also exposes
|
||||||
|
the zero-based `$HYPERFINE_ITERATION` environment variable inside the benchmarked command itself:
|
||||||
|
```sh
|
||||||
|
hyperfine 'my-command > output-${HYPERFINE_ITERATION}.log'
|
||||||
|
```
|
||||||
|
|
||||||
### Intermediate shell
|
### Intermediate shell
|
||||||
|
|
||||||
By default, commands are executed using `sh` on Unix (resolved through `PATH`) or `cmd.exe` on Windows.
|
By default, commands are executed using `sh` on Unix (resolved through `PATH`) or `cmd.exe` on Windows.
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ pub fn standard_deviation<Q: UnsafeRawValue>(values: &[Q], mean: Q) -> Q {
|
|||||||
Q::unsafe_from_raw_value((sum / (values.len() as f64 - 1.0)).sqrt())
|
Q::unsafe_from_raw_value((sum / (values.len() as f64 - 1.0)).sqrt())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute modifized Z-scores for a given sample. A (unmodified) Z-score is defined by
|
/// Compute modified Z-scores for a given sample. A (unmodified) Z-score is defined by
|
||||||
/// `(x_i - x_mean)/x_stddev` whereas the modified Z-score is defined by `(x_i - x_median)/MAD`
|
/// `(x_i - x_mean)/x_stddev` whereas the modified Z-score is defined by `(x_i - x_median)/MAD`
|
||||||
/// where MAD is the median absolute deviation.
|
/// where MAD is the median absolute deviation.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in new issue
Block a user