generated from PlexSheep/rs-base
feat(bench): move benching to actual benches, primitively
cargo devel CI / cargo CI (push) Successful in 6m12s
Details
cargo devel CI / cargo CI (push) Successful in 6m12s
Details
This commit is contained in:
parent
7644970d1f
commit
c7b068ef31
|
@ -64,3 +64,11 @@ test-log = { version = "0.2.16", default-features = false, features = [
|
|||
"color",
|
||||
"trace",
|
||||
] }
|
||||
|
||||
[[bench]]
|
||||
name = "solver_naive"
|
||||
harness = false
|
||||
|
||||
[[bench]]
|
||||
name = "solver_stupid"
|
||||
harness = false
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
||||
use wordle_analyzer::bench::Benchmark;
|
||||
use wordle_analyzer::game::{self, GameBuilder};
|
||||
use wordle_analyzer::solve::{NaiveSolver, Solver};
|
||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let wl = BuiltinWList::english(5);
|
||||
let builder: GameBuilder<'_, BuiltinWList> = game::Game::builder(&wl)
|
||||
.length(5)
|
||||
.max_steps(6)
|
||||
.precompute(true);
|
||||
let solver: NaiveSolver<_> = NaiveSolver::build(&wl)?;
|
||||
let bench = BuiltinBenchmark::build(&wl, solver, builder, 16)?;
|
||||
bench.start(2000, &bench.builder())?;
|
||||
println!("{}", bench.report());
|
||||
Ok(())
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
||||
use wordle_analyzer::bench::Benchmark;
|
||||
use wordle_analyzer::game::{self, GameBuilder};
|
||||
use wordle_analyzer::solve::Solver;
|
||||
use wordle_analyzer::solve::StupidSolver;
|
||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let wl = BuiltinWList::english(5);
|
||||
let builder: GameBuilder<'_, BuiltinWList> = game::Game::builder(&wl)
|
||||
.length(5)
|
||||
.max_steps(6)
|
||||
.precompute(true);
|
||||
let solver: StupidSolver<_> = StupidSolver::build(&wl)?;
|
||||
let bench = BuiltinBenchmark::build(&wl, solver, builder, 16)?;
|
||||
bench.start(2000, &bench.builder())?;
|
||||
println!("{}", bench.report());
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue