Skip to content

Commit 9b7946b

Browse files
authored
Merge pull request #52 from Chessray/eb/combine-run-results
Eb/combine run results
2 parents 7342500 + e384eda commit 9b7946b

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

jmhplot.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def normalize_data_frame_from_path(path: pathlib.Path):
116116
except pd.errors.EmptyDataError:
117117
break
118118

119-
# every 9th line is the interesting one, discard the rest
120-
df = df.iloc[::9, :]
119+
# df = df.iloc[::9, :]
120+
df = df[~df['Benchmark'].str.contains(':')]
121121
df["Benchmark"] = df["Benchmark"].apply(lambda x: x.split('.')[-1])
122122
if normalized is None:
123123
normalized = df
@@ -257,24 +257,35 @@ def plot_result_axis_bars(ax, resultSet: ResultSet) -> None:
257257

258258

259259
def plot_result_set(indexKeys: Tuple, indexTuple: Tuple, resultSet: ResultSet, path: pathlib.Path, include_benchmarks: str, exclude_benchmarks: str, label: str):
260+
# Determine how many colors we need
261+
num_benchmarks = len(resultSet)
262+
263+
# Sample gist_ncar (or nipy_spectral) at discrete intervals
264+
cmap = plt.get_cmap('gist_ncar')
265+
colors = [cmap(i / num_benchmarks) for i in range(num_benchmarks)]
266+
267+
# Set the property cycle with these colors
268+
plt.rc('axes', prop_cycle=plt.cycler('color', colors))
269+
260270
fig = plt.figure(num=None, figsize=(18, 12), dpi=80,
261271
facecolor='w', edgecolor='k')
262272
ax = plt.subplot()
263273

264274
plot_result_axis_bars(ax, resultSet)
265275

276+
plt.suptitle("x86_64 - Xeon E5-1650 v3 @ 3.50GHz - 128GB ECC RAM - Ubuntu 24.04.3 LTS - Kernel: 6.14.0-36-generic")
266277
plt.title(
267278
f'{str(indexKeys)}={str(indexTuple)} include={include_benchmarks} exclude={exclude_benchmarks}')
268-
plt.xlabel("X")
279+
plt.xlabel("# Operations")
269280
plt.ylabel("t (ns)")
270-
plt.legend(loc='lower right')
271-
plt.grid(b='True', which='both')
281+
plt.legend(loc='upper left', bbox_to_anchor=(1, 1))
282+
plt.grid(visible='True', which='both')
272283

273284
name = f'fig_{"_".join([str(t) for t in indexTuple])}_{label}.png'
274285

275286
if path.is_file():
276287
path = path.parent()
277-
fig.savefig(path.joinpath(name))
288+
fig.savefig(path.joinpath(name), bbox_inches='tight')
278289

279290

280291
alpha_pattern = re.compile(f'[A-Za-z0-9_\-+]')

0 commit comments

Comments
 (0)