24 lines
637 B
Rust
24 lines
637 B
Rust
use std::hint::black_box;
|
|
|
|
use criterion::{Criterion, criterion_group, criterion_main};
|
|
use othello::{
|
|
board::{Board, squares::*},
|
|
game::Game,
|
|
};
|
|
|
|
const PLAYS: [Board; 15] = [F5, F4, E3, F3, G4, G5, H4, H5, E6, D3, C4, C5, D6, C6, B5];
|
|
|
|
fn bench_available_all_positions_sequential(c: &mut Criterion) {
|
|
c.bench_function("play_four_move_opening", |b| {
|
|
b.iter(|| {
|
|
let mut game = Game::default();
|
|
for play in PLAYS {
|
|
black_box(game.play(play));
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, bench_available_all_positions_sequential,);
|
|
|
|
criterion_main!(benches);
|