bench: unlimited arena size
This commit is contained in:
parent
44560d9bfa
commit
9e1c2288a0
@ -4,16 +4,16 @@ use othello::{
|
|||||||
repr::{Board, Piece},
|
repr::{Board, Piece},
|
||||||
};
|
};
|
||||||
|
|
||||||
fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize {
|
fn extend_layers_no_pruning(depth: usize) -> usize {
|
||||||
let config = FutureMoveConfig {
|
let config = FutureMoveConfig {
|
||||||
max_depth: depth,
|
max_depth: depth,
|
||||||
min_arena_depth: 0,
|
min_arena_depth: 0,
|
||||||
top_k_children: 5,
|
top_k_children: 5,
|
||||||
up_to_minus: 4,
|
up_to_minus: 4,
|
||||||
max_arena_size: arena_size,
|
max_arena_size: usize::MAX,
|
||||||
do_prune: false,
|
do_prune: false,
|
||||||
print: false,
|
print: false,
|
||||||
children_eval_method: ChildrenEvalMethod::Max,
|
children_eval_method: ChildrenEvalMethod::Average,
|
||||||
};
|
};
|
||||||
let mut fut = FutureMoves::new(Piece::Black, config);
|
let mut fut = FutureMoves::new(Piece::Black, config);
|
||||||
fut.update_from_board(&Board::new().starting_pos());
|
fut.update_from_board(&Board::new().starting_pos());
|
||||||
@ -23,14 +23,11 @@ fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize {
|
|||||||
|
|
||||||
fn criterion_benchmark(c: &mut Criterion) {
|
fn criterion_benchmark(c: &mut Criterion) {
|
||||||
let mut group = c.benchmark_group("extend_layer (no pruning)");
|
let mut group = c.benchmark_group("extend_layer (no pruning)");
|
||||||
const ARENA_SIZE: usize = 10_000_000;
|
|
||||||
|
|
||||||
for depth in 6..8 {
|
for depth in 6..8 {
|
||||||
group.throughput(Throughput::Elements(
|
group.throughput(Throughput::Elements(extend_layers_no_pruning(depth) as u64));
|
||||||
extend_layers_no_pruning(depth, ARENA_SIZE) 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_no_pruning(*depth, ARENA_SIZE));
|
b.iter(|| extend_layers_no_pruning(*depth));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
group.finish();
|
group.finish();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user