bench: say non-pruning

This commit is contained in:
Simon Gardling 2025-02-28 20:44:07 -05:00
parent 60b4fdd836
commit 47050a6871
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -4,7 +4,7 @@ use othello::{
repr::{Board, Piece}, repr::{Board, Piece},
}; };
fn extend_layers_test(depth: usize, arena_size: usize) -> usize { fn extend_layers_no_pruning(depth: usize, arena_size: usize) -> usize {
let config = FutureMoveConfig { let config = FutureMoveConfig {
max_depth: depth, max_depth: depth,
min_arena_depth_sub: 4, min_arena_depth_sub: 4,
@ -19,18 +19,15 @@ fn extend_layers_test(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"); let mut group = c.benchmark_group("extend_layer (no pruning)");
// group.measurement_time(Duration::from_secs(10));
// group.sample_size(1000);
const ARENA_SIZE: usize = 10_000_000; const ARENA_SIZE: usize = 10_000_000;
for depth in 1..8 { for depth in 1..8 {
group.throughput(Throughput::Elements( group.throughput(Throughput::Elements(
extend_layers_test(depth, ARENA_SIZE) 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_test(*depth, ARENA_SIZE)); b.iter(|| extend_layers_no_pruning(*depth, ARENA_SIZE));
}); });
} }
group.finish(); group.finish();