Skip to content

Commit 90ef196

Browse files
committed
TEST: In Zip benchmarks, use the index
Using the index shows more directly the overhead of indexed zip
1 parent 55998bb commit 90ef196

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

benches/zip.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(test)]
22
extern crate test;
3-
use test::{Bencher};
3+
use test::{black_box, Bencher};
44
use ndarray::{Array3, ShapeBuilder, Zip};
55
use ndarray::s;
66
use ndarray::IntoNdProducer;
@@ -33,6 +33,7 @@ pub fn zip_copy_split<'a, A, P, Q>(data: P, out: Q)
3333

3434
pub fn zip_indexed(data: &Array3<f32>, out: &mut Array3<f32>) {
3535
Zip::indexed(data).and(out).apply(|idx, &i, o| {
36+
let _ = black_box(idx);
3637
*o = i;
3738
});
3839
}

0 commit comments

Comments
 (0)