Skip to content

Commit 63f0a1d

Browse files
committed
Remove graph bar plot
1 parent c56b6ce commit 63f0a1d

1 file changed

Lines changed: 1 addition & 33 deletions

File tree

graph

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import os
88
import sys
99

1010
from tabulate import tabulate
11-
import numpy as np
1211
import matplotlib.pyplot as plt
1312

1413
LIBRARIES = ('orjson', 'ujson', 'rapidjson', 'json')
@@ -46,37 +45,6 @@ def box(obj):
4645
plt.savefig('doc/{}.png'.format(group.replace(' ', '_').replace('.json', '')))
4746
plt.close()
4847

49-
def bar(obj):
50-
res = {key: [] for key in LIBRARIES}
51-
groups = set()
52-
for group, val in sorted(obj.items()):
53-
for lib in LIBRARIES:
54-
res[lib].append(np.median(val[lib]['data']))
55-
groups.add(group)
56-
57-
groups = list(reversed(sorted(list(groups))))
58-
59-
fig, ax = plt.subplots()
60-
index = np.arange(len(groups))
61-
bar_width = 0.2
62-
opacity = 0.8
63-
64-
plt.ylabel('milliseconds')
65-
plt.xticks(index + bar_width, [each.split(' ')[0] for each in groups])
66-
plt.legend()
67-
68-
for (idx, lib) in enumerate(LIBRARIES):
69-
plt.bar(
70-
index + (idx * bar_width),
71-
res[lib],
72-
bar_width,
73-
alpha=opacity,
74-
color=COLOR[idx],
75-
label=lib,
76-
)
77-
plt.tight_layout()
78-
plt.show()
79-
8048
def tab(obj):
8149
buf = io.StringIO()
8250
headers = ('Library', 'Median (milliseconds)', 'Operations per second', 'Relative (latency)')
@@ -106,5 +74,5 @@ def tab(obj):
10674
try:
10775
locals()[sys.argv[1]](aggregate())
10876
except KeyError:
109-
sys.stderr.write("usage: graph (box|bar|tab)\n")
77+
sys.stderr.write("usage: graph (box|tab)\n")
11078
sys.exit(1)

0 commit comments

Comments
 (0)