Skip to content

Commit a847d50

Browse files
hazeycodeCopilot
andauthored
benchmark: prealloc arrays
Co-authored-by: Copilot <[email protected]>
1 parent 3a6b5d4 commit a847d50

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
@@ -316,9 +316,9 @@ noinline fn cross3Dot3ScaleBiasBenchmark(allocator: std.mem.Allocator, comptime
316316
noinline fn quatBenchmark(allocator: std.mem.Allocator, comptime count: comptime_int) !void {
317317
std.debug.print("{s:>42} - ", .{"quaternion mul benchmark (AOS)"});
318318

319-
var data0 = try std.ArrayList([4]f32).initCapacity(allocator, 0);
319+
var data0 = try std.ArrayList([4]f32).initCapacity(allocator, 256);
320320
defer data0.deinit(allocator);
321-
var data1 = try std.ArrayList([4]f32).initCapacity(allocator, 0);
321+
var data1 = try std.ArrayList([4]f32).initCapacity(allocator, 256);
322322
defer data1.deinit(allocator);
323323

324324
var i: usize = 0;

0 commit comments

Comments
 (0)