Skip to content

Commit

Permalink
benchmark: add trend lines to plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Wünsche committed Feb 18, 2024
1 parent f13c07c commit 312fbab
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions betree/haura-benchmarks/haura-plots/haura_plots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,18 @@ def plot_evaluation_latency(path, variant):
fig, ax = plt.subplots(1,1,figsize=(6,4))
reads = data[data['op'] == 'r']
writes = data[data['op'] == 'w']
ax.scatter(reads['size'], reads['latency_ns'], marker='x', label="read")
ax.scatter(writes['size'], writes['latency_ns'], marker='.', label="write")
if len(reads) > 0:
ax.scatter(reads['size'], reads['latency_ns'], marker='x', label="read")
size = reads['size'].to_numpy()
latency = reads['latency_ns'].to_numpy()
p = np.polynomial.Polynomial.fit(size, latency, 1)
ax.plot(np.sort(size), p(np.sort(size)), linestyle=':', label='read trend', color='black')
if len(writes) > 0:
ax.scatter(writes['size'], writes['latency_ns'], marker='.', label="write")
size = writes['size'].to_numpy()
latency = writes['latency_ns'].to_numpy()
p = np.polynomial.Polynomial.fit(size, latency, 1)
ax.plot(np.sort(size), p(np.sort(size)), linestyle='-.', label='write trend', color='black')
xticks = np.arange(0, 12 * 1024 * 1024 + 1, 2 * 1024 * 1024)
ax.set_xticks(xticks, [int(x / 1024) for x in xticks])
ax.set_xlabel("Size in KiB")
Expand Down

0 comments on commit 312fbab

Please sign in to comment.