fix bench
This commit is contained in:
parent
a02dd72dc1
commit
63a20d875f
@ -5,8 +5,8 @@ use othello::{
|
|||||||
};
|
};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
fn extend_layers_test(depth: usize, expire: usize) {
|
fn extend_layers_test(depth: usize) {
|
||||||
let mut fut = FutureMoves::new(Piece::Black, depth, expire);
|
let mut fut = FutureMoves::new(Piece::Black, depth);
|
||||||
fut.set_root_from_board(Board::new().starting_pos());
|
fut.set_root_from_board(Board::new().starting_pos());
|
||||||
fut.extend_layers();
|
fut.extend_layers();
|
||||||
}
|
}
|
||||||
@ -17,11 +17,11 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
group.measurement_time(Duration::from_secs(10));
|
group.measurement_time(Duration::from_secs(10));
|
||||||
group.sample_size(1000);
|
group.sample_size(1000);
|
||||||
|
|
||||||
for (depth, expire) in (4..8).zip([EXPIRE].into_iter().cycle()) {
|
for depth in 4..8 {
|
||||||
// TODO! maybe somehow get throughput from `extend_layers`?
|
// TODO! maybe somehow get throughput from `extend_layers`?
|
||||||
// group.throughput(Throughput::Elements(depth as u64));
|
// group.throughput(Throughput::Elements(depth as u64));
|
||||||
group.bench_with_input(BenchmarkId::from_parameter(depth), &depth, |b, depth| {
|
group.bench_with_input(BenchmarkId::from_parameter(depth), &depth, |b, depth| {
|
||||||
b.iter(|| extend_layers_test(*depth, expire));
|
b.iter(|| extend_layers_test(*depth));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
group.finish();
|
group.finish();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user