generated from PlexSheep/rs-base
Compare commits
3 Commits
master
...
feat/bench
Author | SHA1 | Date |
---|---|---|
Christoph J. Scherr | c7b068ef31 | |
Christoph J. Scherr | 7644970d1f | |
PlexSheep | 813fff8647 |
|
@ -64,3 +64,11 @@ test-log = { version = "0.2.16", default-features = false, features = [
|
||||||
"color",
|
"color",
|
||||||
"trace",
|
"trace",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "solver_naive"
|
||||||
|
harness = false
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "solver_stupid"
|
||||||
|
harness = false
|
||||||
|
|
|
@ -26,5 +26,6 @@ have to guess words by slowly guessing the letters contained in it.
|
||||||
Included in this repository are the following wordlists:
|
Included in this repository are the following wordlists:
|
||||||
|
|
||||||
<!-- TODO: make sure this is properly cited -->
|
<!-- TODO: make sure this is properly cited -->
|
||||||
* [3Blue1Brown Top English words](./data/wordlists/german_SUBTLEX-DE.json) --- [`./data/wordlists/en_US_3b1b_freq_map.json`](https://github.com/3b1b/videos/tree/master/_2022/wordle/data)
|
* [`./data/wordlists/en_US_3b1b_freq_map.json`](./data/wordlists/en_US_3b1b_freq_map.json) --- [3Blue1Brown Top English words](https://github.com/3b1b/videos/tree/master/_2022/wordle/data)
|
||||||
* [~33.000 Common German Words](./data/wordlists/german_SUBTLEX-DE.json) --- [SUBTLEX-DE](https://osf.io/py9ba/files/osfstorage)
|
* [`./data/wordlists/german_SUBTLEX-DE_full.json`](./data/wordlists/german_SUBTLEX-DE_full.json) --- [SUBTLEX-DE ~33.000 Common German Words](https://osf.io/py9ba/files/osfstorage)
|
||||||
|
* [`./data/wordlists/german_SUBTLEX-DE_small.json`](./data/wordlists/german_SUBTLEX-DE_small.json) --- [SUBTLEX-DE ~33.000 Common German Words (reduced to most common)](https://osf.io/py9ba/files/osfstorage)
|
||||||
|
|
|
@ -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(())
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ use std::collections::HashMap;
|
||||||
use libpt::log::{debug, error, info, trace};
|
use libpt::log::{debug, error, info, trace};
|
||||||
|
|
||||||
use crate::error::{SolverError, WResult};
|
use crate::error::{SolverError, WResult};
|
||||||
use crate::game::evaluation::{Evaluation};
|
use crate::game::evaluation::Evaluation;
|
||||||
use crate::wlist::word::{Word, WordData};
|
use crate::wlist::word::{Word, WordData};
|
||||||
use crate::wlist::WordList;
|
use crate::wlist::WordList;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
use test_log::test; // set the log level with an envvar: `RUST_LOG=trace cargo test`
|
use test_log::test; // set the log level with an envvar: `RUST_LOG=trace cargo test`
|
||||||
|
|
||||||
use wordle_analyzer::game::evaluation::Evaluation;
|
|
||||||
use wordle_analyzer::game::Game;
|
|
||||||
use wordle_analyzer::solve::{AnyBuiltinSolver, NaiveSolver, Solver, StupidSolver};
|
use wordle_analyzer::solve::{AnyBuiltinSolver, NaiveSolver, Solver, StupidSolver};
|
||||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
||||||
use wordle_analyzer::wlist::word::{Word, WordData};
|
|
||||||
use wordle_analyzer::wlist::WordList;
|
use wordle_analyzer::wlist::WordList;
|
||||||
|
|
||||||
fn wordlist() -> impl WordList {
|
fn wordlist() -> impl WordList {
|
||||||
|
|
Loading…
Reference in New Issue