Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ZipSlices from benchmarks #911

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions benches/bench1.rs
Original file line number Diff line number Diff line change
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.