Skip to content

Commit d9d97e7

Browse files
FreezyLemonshssoichiro
authored andcommitted
fix(bench): pass stride in bytes
used to be stride in pixels which is incorrect
1 parent 1d083fd commit d9d97e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benches/plane.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ fn bench_copy_from_u8_slice_with_stride_u16(c: &mut Criterion) {
192192
let mut plane = create_plane_u16();
193193
// Add 64 pixels of padding per row for a realistic strided scenario
194194
let stride = WIDTH + 64;
195-
let stride_nz = NonZeroUsize::new(stride).unwrap();
195+
let stride_bytes = NonZeroUsize::new(stride * 2).unwrap();
196196
let source = create_strided_byte_source_u16(stride);
197197

198198
c.bench_function("copy_from_u8_slice_with_stride_u16", |b| {
199199
b.iter(|| {
200200
black_box(&mut plane)
201-
.copy_from_u8_slice_with_stride(black_box(&source), stride_nz)
201+
.copy_from_u8_slice_with_stride(black_box(&source), stride_bytes)
202202
.unwrap();
203203
});
204204
});

0 commit comments

Comments
 (0)