mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-09-11 14:07:02 +03:00
Compare commits
5 Commits
bc962c41b7
...
df0c65e8b7
Author | SHA1 | Date | |
---|---|---|---|
|
df0c65e8b7 | ||
|
b0d29f01b0 | ||
|
ef9e1409c6 | ||
|
824aafbd69 | ||
|
2e4fbf4117 |
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -72,9 +72,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.80"
|
||||
version = "1.0.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
|
||||
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
|
||||
|
||||
[[package]]
|
||||
name = "approx"
|
||||
|
@ -213,14 +213,14 @@ pacman -S hyperfine
|
||||
|
||||
### On Debian Linux
|
||||
|
||||
On Debian Linux, hyperfine can be installed [from the testing repositories](https://packages.debian.org/testing/main/hyperfine)
|
||||
On Debian Linux, hyperfine can be installed [from the testing repositories](https://packages.debian.org/testing/main/hyperfine):
|
||||
```
|
||||
apt install hyperfine
|
||||
```
|
||||
|
||||
### On Exherbo Linux
|
||||
|
||||
On Exherbo Linux, hyperfine can be installed [from the rust repositories]([https://packages.debian.org/testing/main/hyperfine](https://gitlab.exherbo.org/exherbo/rust/-/tree/master/packages/sys-apps/hyperfine)
|
||||
On Exherbo Linux, hyperfine can be installed [from the rust repositories](https://gitlab.exherbo.org/exherbo/rust/-/tree/master/packages/sys-apps/hyperfine):
|
||||
```
|
||||
cave resolve -x repository/rust
|
||||
cave resolve -x hyperfine
|
||||
|
@ -6,6 +6,7 @@ import argparse
|
||||
import json
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.font_manager
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("file", help="JSON file with benchmark results")
|
||||
@ -14,6 +15,11 @@ parser.add_argument(
|
||||
"--labels", help="Comma-separated list of entries for the plot legend"
|
||||
)
|
||||
parser.add_argument("--bins", help="Number of bins (default: auto)")
|
||||
parser.add_argument(
|
||||
"--legend-location", help="Location of the legend on plot (default: upper center)",
|
||||
choices=["upper center", "lower center", "right", "left", "best", "upper left", "upper right", "lower left", "lower right", "center left", "center right", "center"],
|
||||
default="upper center"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--type", help="Type of histogram (*bar*, barstacked, step, stepfilled)"
|
||||
)
|
||||
@ -47,6 +53,7 @@ t_max = float(args.t_max) if args.t_max else np.max(list(map(np.max, all_times))
|
||||
bins = int(args.bins) if args.bins else "auto"
|
||||
histtype = args.type if args.type else "bar"
|
||||
|
||||
plt.figure(figsize=(10, 5))
|
||||
plt.hist(
|
||||
all_times,
|
||||
label=labels,
|
||||
@ -54,7 +61,12 @@ plt.hist(
|
||||
histtype=histtype,
|
||||
range=(t_min, t_max),
|
||||
)
|
||||
plt.legend(prop={"family": ["Source Code Pro", "Fira Mono", "Courier New"]})
|
||||
plt.legend(
|
||||
loc=args.legend_location,
|
||||
fancybox=True,
|
||||
shadow=True,
|
||||
prop={"size": 7, "family": ["Source Code Pro", "Fira Mono", "Courier New"]}
|
||||
)
|
||||
|
||||
plt.xlabel("Time [s]")
|
||||
if args.title:
|
||||
@ -66,6 +78,6 @@ else:
|
||||
plt.ylim(0, None)
|
||||
|
||||
if args.output:
|
||||
plt.savefig(args.output)
|
||||
plt.savefig(args.output, dpi=600)
|
||||
else:
|
||||
plt.show()
|
||||
|
@ -225,6 +225,7 @@ fn build_command() -> Command {
|
||||
.arg(
|
||||
Arg::new("style")
|
||||
.long("style")
|
||||
.short('l')
|
||||
.action(ArgAction::Set)
|
||||
.value_name("TYPE")
|
||||
.value_parser(["auto", "basic", "full", "nocolor", "color", "none"])
|
||||
@ -240,6 +241,7 @@ fn build_command() -> Command {
|
||||
.arg(
|
||||
Arg::new("sort")
|
||||
.long("sort")
|
||||
.short('t')
|
||||
.action(ArgAction::Set)
|
||||
.value_name("METHOD")
|
||||
.value_parser(["auto", "command", "mean-time"])
|
||||
@ -314,6 +316,7 @@ fn build_command() -> Command {
|
||||
.arg(
|
||||
Arg::new("show-output")
|
||||
.long("show-output")
|
||||
.short('d')
|
||||
.action(ArgAction::SetTrue)
|
||||
.conflicts_with("style")
|
||||
.help(
|
||||
@ -326,6 +329,7 @@ fn build_command() -> Command {
|
||||
.arg(
|
||||
Arg::new("output")
|
||||
.long("output")
|
||||
.short('O')
|
||||
.conflicts_with("show-output")
|
||||
.action(ArgAction::Set)
|
||||
.value_name("WHERE")
|
||||
@ -349,6 +353,7 @@ fn build_command() -> Command {
|
||||
.arg(
|
||||
Arg::new("input")
|
||||
.long("input")
|
||||
.short('I')
|
||||
.action(ArgAction::Set)
|
||||
.num_args(1)
|
||||
.value_name("WHERE")
|
||||
|
Loading…
Reference in New Issue
Block a user