Skip to content

Commit 250fdb6

Browse files
committed
Update script
1 parent 1dbf5bd commit 250fdb6

1 file changed

Lines changed: 45 additions & 39 deletions

File tree

benchOutput/performance.py

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@ def plot_line_rel(csv, ax, title):
2121
for benchmark in data['benchmark']:
2222
row = data[data['benchmark'] == benchmark]
2323
plot_data = [
24-
# row['ms (rean)'].values[0] / row['ms (init)'].values[0],
24+
row['ms (rean)'].values[0] / row['ms (init)'].values[0],
2525
row['ms (NoOpt)'].values[0] / row['ms (rean)'].values[0],
26-
row['ms (CI)'].values[0] / row['ms (rean)'].values[0],
27-
row['ms (DI)'].values[0] / row['ms (rean)'].values[0],
28-
row['ms (CI-DI)'].values[0] / row['ms (rean)'].values[0],
29-
row['ms (WI)'].values[0] / row['ms (rean)'].values[0],
30-
row['ms (DI-WI)'].values[0] / row['ms (rean)'].values[0],
31-
row['ms (CI-WI)'].values[0] / row['ms (rean)'].values[0],
32-
row['ms (CI-DI-WI)'].values[0] / row['ms (rean)'].values[0],
26+
# row['ms (CI)'].values[0] / row['ms (rean)'].values[0],
27+
# row['ms (DI)'].values[0] / row['ms (rean)'].values[0],
28+
# row['ms (CI-DI)'].values[0] / row['ms (rean)'].values[0],
29+
# row['ms (WI)'].values[0] / row['ms (rean)'].values[0],
30+
# row['ms (DI-WI)'].values[0] / row['ms (rean)'].values[0],
31+
# row['ms (CI-WI)'].values[0] / row['ms (rean)'].values[0],
32+
# row['ms (CI-DI-WI)'].values[0] / row['ms (rean)'].values[0],
33+
row['ms (CI-DI-WI+CY)'].values[0] / row['ms (rean)'].values[0],
3334
]
3435
ax.plot(plot_data, label=benchmark)
3536
ax.set_xlabel(title)
36-
ax.set_xticklabels(['none', 'NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
37-
ax.set_ylabel('Relative time to reanalysis')
37+
ax.set_xticklabels(['none', 'Unoptimised', 'Optimised'])
38+
# ax.set_xticklabels(['none', 'NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
39+
ax.set_ylabel('Time relative to reanalysis')
3840
ax.set_yscale('log')
3941

4042
def plot_line(csv, ax, title):
@@ -44,36 +46,40 @@ def plot_line(csv, ax, title):
4446
plot_data = [
4547
row['ms (rean)'].values[0],
4648
row['ms (NoOpt)'].values[0],
47-
row['ms (CI)'].values[0],
48-
row['ms (DI)'].values[0],
49-
row['ms (CI-DI)'].values[0],
50-
row['ms (WI)'].values[0],
51-
row['ms (DI-WI)'].values[0],
52-
row['ms (CI-WI)'].values[0],
53-
row['ms (CI-DI-WI)'].values[0],
49+
#row['ms (CI)'].values[0],
50+
#row['ms (DI)'].values[0],
51+
#row['ms (CI-DI)'].values[0],
52+
#row['ms (WI)'].values[0],
53+
#row['ms (DI-WI)'].values[0],
54+
#row['ms (CI-WI)'].values[0],
55+
#row['ms (CI-DI-WI)'].values[0],
56+
row['ms (CI-DI-WI+CY)'].values[0],
5457
]
5558
ax.plot(plot_data, label=benchmark)
5659
ax.set_xlabel(title)
5760
ax.set_yscale('log')
58-
ax.set_xticklabels(['none', 'rean', 'NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
61+
ax.set_xticklabels(['none', 'Unoptimised', 'Optimised'])
62+
#ax.set_xticklabels(['none', 'rean', 'NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
5963
ax.set_ylabel('Time (ms)')
6064

6165
def plot_box(csv, ax, title, filtering = lambda x: x, log = True):
6266
data = filtering(parse_data(csv))
6367
if len(data) == 0:
6468
return
6569
sns.boxplot(ax=ax, data=[
66-
np.divide(data['ms (NoOpt)'], data['ms (rean)']),
67-
np.divide(data['ms (CI)'], data['ms (rean)']),
68-
np.divide(data['ms (DI)'], data['ms (rean)']),
69-
np.divide(data['ms (CI-DI)'], data['ms (rean)']),
70-
np.divide(data['ms (WI)'], data['ms (rean)']),
71-
np.divide(data['ms (DI-WI)'], data['ms (rean)']),
72-
np.divide(data['ms (CI-WI)'], data['ms (rean)']),
73-
np.divide(data['ms (CI-DI-WI)'], data['ms (rean)']),
70+
#np.divide(data['ms (NoOpt)'], data['ms (rean)']),
71+
#np.divide(data['ms (CI)'], data['ms (rean)']),
72+
#np.divide(data['ms (DI)'], data['ms (rean)']),
73+
#np.divide(data['ms (CI-DI)'], data['ms (rean)']),
74+
#np.divide(data['ms (WI)'], data['ms (rean)']),
75+
#np.divide(data['ms (DI-WI)'], data['ms (rean)']),
76+
#np.divide(data['ms (CI-WI)'], data['ms (rean)']),
77+
#np.divide(data['ms (CI-DI-WI)'], data['ms (rean)']),
78+
np.divide(data['ms (CI-DI-WI+CY)'].astype(int), data['ms (rean)'].astype(int)),
7479
])
7580
ax.set_xlabel(title + ' ({} programs)'.format(len(data)))
76-
ax.set_xticklabels(['NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
81+
#ax.set_xticklabels(['NoOpt', 'CI', 'DI', 'CI-DI', 'WI', 'DI-WI', 'CI-WI', 'CI-DI-WI'])
82+
ax.set_xticklabels(['Optimised'])
7783
ax.set_ylabel('Time relative to full reanalysis')
7884
if log:
7985
ax.set_yscale('log')
@@ -87,19 +93,19 @@ def plot_box(csv, ax, title, filtering = lambda x: x, log = True):
8793
fig.set_size_inches(16, 16)
8894
fig.set_dpi(200)
8995
plot_box('type-curated-performance.csv', ax[0], 'Curated', log = False)
90-
plot_box('type-generated-performance.csv', ax[1], 'Generated, initial analysis <1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] < 1000])
96+
plot_box('type-generated-performance.csv', ax[1], 'Generated, initial analysis <1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] < 1000].dropna)
9197
#plot_box('type-generated-performance.csv', ax[2], 'Generated, initial analysis <1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] < 1000])
92-
plot_box('type-generated-performance.csv', ax[2], 'Generated, initial analysis >=1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] >= 1000])
93-
plot_box('type-generated-performance.csv', ax[3], 'Generated, initial analysis >=1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] >= 1000])
98+
plot_box('type-generated-performance.csv', ax[2], 'Generated, initial analysis >=1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] >= 1000].dropna)
99+
plot_box('type-generated-performance.csv', ax[3], 'Generated, initial analysis >=1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] >= 1000].dropna)
94100

95101
plt.savefig('type-performance.pdf')
96102

97-
fig, ax = plt.subplots(4)
98-
fig.set_size_inches(16, 16)
99-
fig.set_dpi(200)
100-
plot_box('cp-curated-performance.csv', ax[0], 'Curated', log = False)
101-
plot_box('cp-generated-performance.csv', ax[1], 'Generated, initial analysis <1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] < 1000])
102-
#plot_box('cp-generated-performance.csv', ax[2], 'Generated, initial analysis <1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] < 1000])
103-
plot_box('cp-generated-performance.csv', ax[2], 'Generated, initial analysis >=1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] >= 1000])
104-
plot_box('cp-generated-performance.csv', ax[3], 'Generated, initial analysis >=1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] >= 1000])
105-
plt.savefig('cp-performance.pdf')
103+
#fig, ax = plt.subplots(4)
104+
#fig.set_size_inches(16, 16)
105+
#fig.set_dpi(200)
106+
#plot_box('cp-curated-performance.csv', ax[0], 'Curated', log = False)
107+
#plot_box('cp-generated-performance.csv', ax[1], 'Generated, initial analysis <1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] < 1000])
108+
##plot_box('cp-generated-performance.csv', ax[2], 'Generated, initial analysis <1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] < 1000])
109+
#plot_box('cp-generated-performance.csv', ax[2], 'Generated, initial analysis >=1s, full reanalysis <1s', lambda x: x[x['ms (rean)'] < 1000][x['ms (init)'] >= 1000])
110+
#plot_box('cp-generated-performance.csv', ax[3], 'Generated, initial analysis >=1s, full reanalysis >=1s', lambda x: x[x['ms (rean)'] >= 1000][x['ms (init)'] >= 1000])
111+
#plt.savefig('cp-performance.pdf')

0 commit comments

Comments
 (0)