Skip to content

Commit 2159419

Browse files
authored
Merge pull request #8 from linksplatform/issue-7-d3d583fdc59a
Fix first benchmark image to use raw values instead of floor division
2 parents ca44bd3 + cb59b2b commit 2159419

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

rust/out.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,18 @@ def annotate(v):
132132
# Plots
133133
# ─────────────────────────────────────────────────────────────────────────────
134134
def bench1():
135-
"""Horizontal bars – scaled (divide by 10 000 000)."""
136-
scale = lambda arr: [max(1, x // 10_000_000) for x in arr]
135+
"""Horizontal bars – raw values (pixel scale)."""
137136
y, w = np.arange(len(ordered_ops)), 0.1
138137
fig, ax = plt.subplots(figsize=(12, 8))
139138

140-
ax.barh(y - 2*w, scale(du_volatile_arr), w, label='Doublets United Volatile', color='salmon')
141-
ax.barh(y - w, scale(du_nonvolatile_arr),w, label='Doublets United NonVolatile',color='red')
142-
ax.barh(y , scale(ds_volatile_arr), w, label='Doublets Split Volatile', color='lightgreen')
143-
ax.barh(y + w, scale(ds_nonvolatile_arr), w, label='Doublets Split NonVolatile', color='green')
144-
ax.barh(y + 2*w, scale(neo4j_non_arr), w, label='Neo4j NonTransaction', color='lightblue')
145-
ax.barh(y + 3*w, scale(neo4j_trans_arr), w, label='Neo4j Transaction', color='blue')
139+
ax.barh(y - 2*w, du_volatile_arr, w, label='Doublets United Volatile', color='salmon')
140+
ax.barh(y - w, du_nonvolatile_arr,w, label='Doublets United NonVolatile',color='red')
141+
ax.barh(y , ds_volatile_arr, w, label='Doublets Split Volatile', color='lightgreen')
142+
ax.barh(y + w, ds_nonvolatile_arr, w, label='Doublets Split NonVolatile', color='green')
143+
ax.barh(y + 2*w, neo4j_non_arr, w, label='Neo4j NonTransaction', color='lightblue')
144+
ax.barh(y + 3*w, neo4j_trans_arr, w, label='Neo4j Transaction', color='blue')
146145

147-
ax.set_xlabel('Time (ns) – scaled')
146+
ax.set_xlabel('Time (ns)')
148147
ax.set_title ('Benchmark Comparison: Neo4j vs Doublets (Rust)')
149148
ax.set_yticks(y); ax.set_yticklabels(ordered_ops); ax.legend()
150149
fig.tight_layout(); plt.savefig("bench_rust.png"); plt.close(fig)

0 commit comments

Comments
 (0)