mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
factor::benches::table: Match BenchmarkId w/ criterion's conventions
See https://bheisler.github.io/criterion.rs/book/user_guide/comparing_functions.html
This commit is contained in:
parent
7c649bc74e
commit
1cd001f529
1 changed files with 18 additions and 26 deletions
|
@ -28,10 +28,7 @@ fn table(c: &mut Criterion) {
|
|||
group.throughput(Throughput::Elements(INPUT_SIZE as _));
|
||||
for a in inputs.take(10) {
|
||||
let a_str = format!("{:?}", a);
|
||||
group.bench_with_input(
|
||||
BenchmarkId::from_parameter("chunked_".to_owned() + &a_str),
|
||||
&a,
|
||||
|b, &a| {
|
||||
group.bench_with_input(BenchmarkId::new("factor_chunk", &a_str), &a, |b, &a| {
|
||||
b.iter(|| {
|
||||
let mut n_s = a.clone();
|
||||
let mut f_s: [_; INPUT_SIZE] = array_init(|_| Factors::one());
|
||||
|
@ -39,12 +36,8 @@ fn table(c: &mut Criterion) {
|
|||
factor_chunk(n_s.try_into().unwrap(), f_s.try_into().unwrap())
|
||||
}
|
||||
})
|
||||
},
|
||||
);
|
||||
group.bench_with_input(
|
||||
BenchmarkId::from_parameter("seq_".to_owned() + &a_str),
|
||||
&a,
|
||||
|b, &a| {
|
||||
});
|
||||
group.bench_with_input(BenchmarkId::new("factor", &a_str), &a, |b, &a| {
|
||||
b.iter(|| {
|
||||
let mut n_s = a.clone();
|
||||
let mut f_s: [_; INPUT_SIZE] = array_init(|_| Factors::one());
|
||||
|
@ -52,8 +45,7 @@ fn table(c: &mut Criterion) {
|
|||
factor(n, f)
|
||||
}
|
||||
})
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
group.finish()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue