Skip to content

Commit

Permalink
Remove ZipSlices from benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Apr 10, 2024
1 parent 1c5d5cd commit 6de2f5c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 270 deletions.
74 changes: 0 additions & 74 deletions benches/bench1.rs
Expand Up @@ -7,10 +7,6 @@ use std::cmp;
use std::iter::repeat;
use std::ops::{Add, Range};

mod extra;

use crate::extra::ZipSlices;

fn slice_iter(c: &mut Criterion) {
let xs: Vec<_> = repeat(1i32).take(20).collect();

Expand Down Expand Up @@ -120,72 +116,6 @@ fn zip_slices_ziptuple(c: &mut Criterion) {
});
}

fn zipslices(c: &mut Criterion) {
let xs = vec![0; 1024];
let ys = vec![0; 768];
let xs = black_box(xs);
let ys = black_box(ys);

c.bench_function("zipslices", move |b| {
b.iter(|| {
for (&x, &y) in ZipSlices::new(&xs, &ys) {
black_box(x);
black_box(y);
}
})
});
}

fn zipslices_mut(c: &mut Criterion) {
let xs = vec![0; 1024];
let ys = vec![0; 768];
let xs = black_box(xs);
let mut ys = black_box(ys);

c.bench_function("zipslices mut", move |b| {
b.iter(|| {
for (&x, &mut y) in ZipSlices::from_slices(&xs[..], &mut ys[..]) {
black_box(x);
black_box(y);
}
})
});
}

fn zipdot_i32_zipslices(c: &mut Criterion) {
let xs = vec![2; 1024];
let ys = vec![2; 768];
let xs = black_box(xs);
let ys = black_box(ys);

c.bench_function("zipdot i32 zipslices", move |b| {
b.iter(|| {
let mut s = 0i32;
for (&x, &y) in ZipSlices::new(&xs, &ys) {
s += x * y;
}
s
})
});
}

fn zipdot_f32_zipslices(c: &mut Criterion) {
let xs = vec![2f32; 1024];
let ys = vec![2f32; 768];
let xs = black_box(xs);
let ys = black_box(ys);

c.bench_function("zipdot f32 zipslices", move |b| {
b.iter(|| {
let mut s = 0.;
for (&x, &y) in ZipSlices::new(&xs, &ys) {
s += x * y;
}
s
})
});
}

fn zip_checked_counted_loop(c: &mut Criterion) {
let xs = vec![0; 1024];
let ys = vec![0; 768];
Expand Down Expand Up @@ -801,10 +731,6 @@ criterion_group!(
zipdot_f32_default_zip,
zip_default_zip3,
zip_slices_ziptuple,
zipslices,
zipslices_mut,
zipdot_i32_zipslices,
zipdot_f32_zipslices,
zip_checked_counted_loop,
zipdot_i32_checked_counted_loop,
zipdot_f32_checked_counted_loop,
Expand Down
2 changes: 0 additions & 2 deletions benches/extra/mod.rs

This file was deleted.

194 changes: 0 additions & 194 deletions benches/extra/zipslices.rs

This file was deleted.

0 comments on commit 6de2f5c

Please sign in to comment.