From 0ba8a20bb86d09d5bf4b44d98569dd8714dbf33a Mon Sep 17 00:00:00 2001 From: sharkdp Date: Wed, 12 Dec 2018 19:54:57 +0100 Subject: [PATCH] Add script to plot benchmark results --- scripts/plot_benchmark_results.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/plot_benchmark_results.py diff --git a/scripts/plot_benchmark_results.py b/scripts/plot_benchmark_results.py new file mode 100755 index 0000000..395860e --- /dev/null +++ b/scripts/plot_benchmark_results.py @@ -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()