Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(benchmarks): script colors + print results #377

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/view_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@


def random_color_generator():
# take [r, g, b] from colormap
# Dark2 chosen for visibility from
# https://matplotlib.org/stable/users/explain/colors/colormaps.html#qualitative
return plt.colormaps["Dark2"](random.random())[:3]
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
return (r / 255, g / 255, b / 255)


def view_results(paths):
Expand Down
4 changes: 2 additions & 2 deletions src/benchmarks.zig
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ pub fn benchmarkCSV(

if (j == runtime_info.fields.len - 1) {
// dont print trailing comma
try writer_average.print("{d}, {d}, {any}, {any}", .{ f_max, f_min, f_mean, f_std_dev });
try writer_average.print("{d}, {d}, {any}, {any}", .{ f_min, f_max, f_mean, f_std_dev });
} else {
try writer_average.print("{d}, {d}, {any}, {any}, ", .{ f_max, f_min, f_mean, f_std_dev });
try writer_average.print("{d}, {d}, {any}, {any}, ", .{ f_min, f_max, f_mean, f_std_dev });
}
}
try writer_average.print("\n", .{});
Expand Down
Loading