benchmark silo added
[c11concurrency-benchmarks.git] / silo / benchmarks / results / make_graphs-2.py
1 #!/usr/bin/env python
2
3 import matplotlib
4 import pylab as plt
5 import numpy as np
6
7 import os
8 import sys
9
10 if __name__ == '__main__':
11   files = sys.argv[1:]
12   for f in files:
13     execfile(f)
14     for db in DBS:
15       values = []
16       for t in THREADS:
17         # find config in results...
18         V = None
19         for (r, v) in RESULTS:
20           if r['db'] == db and r['threads'] == t:
21             V = v
22             break
23         assert V
24         values.append(V)
25       plt.plot(THREADS, values)
26     #for (db, res) in zip(DBS[:-1], RESULTS):
27     #  #plt.plot(THREADS, np.log(np.array(res)))
28     #  #plt.plot(THREADS, res)
29     #  #plt.plot(THREADS, np.array(res)/np.array(THREADS)) # per-core
30     #  plt.plot(THREADS, np.log10(np.array(res)/np.array(THREADS))) # per-core
31     plt.xlabel('num threads')
32     plt.ylabel('txns/sec')
33     #plt.ylabel('ops/sec/core')
34     #plt.ylabel('$log_{10}$ ops/sec/thread')
35     plt.legend(DBS, loc='right')
36     plt.title('TPCC workload scale factor 10')
37     plt.savefig('.'.join(os.path.basename(f).split('.')[:-1] + ['pdf']))
38     plt.close()