mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Add script to plot benchmark results
This commit is contained in:
1 parent
51fe31e7d2
commit
0ba8a20bb8
1 file changed
+20
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("file", help="JSON file with benchmark results")
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.file) as f:
|
||||
results = json.load(f)["results"]
|
||||
|
||||
commands = [b["command"] for b in results]
|
||||
times = [b["times"] for b in results]
|
||||
|
||||
plt.boxplot(times, labels=commands)
|
||||
plt.ylabel("Time [s]")
|
||||
plt.ylim(0, None)
|
||||
plt.show()
|
||||
Reference in new issue
Block a user