Skip to content

Commit 3a6b5d4

Browse files
hazeycodeCopilot
andauthored
benchmark: prealloc arrays
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3ec709a commit 3a6b5d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/benchmark.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ noinline fn cross3ScaleBiasBenchmark(allocator: std.mem.Allocator, comptime coun
245245
noinline fn cross3Dot3ScaleBiasBenchmark(allocator: std.mem.Allocator, comptime count: comptime_int) !void {
246246
std.debug.print("{s:>42} - ", .{"cross3, dot3, scale, bias benchmark (AOS)"});
247247

248-
var data0 = try std.ArrayList([3]f32).initCapacity(allocator, 0);
248+
var data0 = try std.ArrayList([3]f32).initCapacity(allocator, 256);
249249
defer data0.deinit(allocator);
250-
var data1 = try std.ArrayList([3]f32).initCapacity(allocator, 0);
250+
var data1 = try std.ArrayList([3]f32).initCapacity(allocator, 256);
251251
defer data1.deinit(allocator);
252252

253253
var i: usize = 0;

0 commit comments

Comments
 (0)