diff options
| author | mat <git@matdoes.dev> | 2023-10-02 17:51:38 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-02 17:51:38 -0500 |
| commit | d0505f7de30e4a9a330ef99d0082849ee44723e0 (patch) | |
| tree | f91879b0423eb0329efd2cb12a10a4e98b3b366d /azalea/benches | |
| parent | c3d27487cae6af5d593193b922d1e81e93a1c45d (diff) | |
| download | azalea-drasl-d0505f7de30e4a9a330ef99d0082849ee44723e0.tar.xz | |
optimize pathfinder more
Diffstat (limited to 'azalea/benches')
| -rw-r--r-- | azalea/benches/pathfinder.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/azalea/benches/pathfinder.rs b/azalea/benches/pathfinder.rs index 34b6f91c..e7c52d57 100644 --- a/azalea/benches/pathfinder.rs +++ b/azalea/benches/pathfinder.rs @@ -4,6 +4,7 @@ use azalea::{ pathfinder::{ astar::{self, a_star}, goals::BlockPosGoal, + moves::PathfinderCtx, Goal, }, BlockPos, @@ -73,13 +74,14 @@ fn generate_bedrock_world( fn bench_pathfinder(c: &mut Criterion) { c.bench_function("bedrock", |b| { let mut partial_chunks = PartialChunkStorage::new(32); - let successors_fn = azalea::pathfinder::moves::parkour::parkour_move; + let successors_fn = azalea::pathfinder::moves::default_move; b.iter(|| { let (world, start, end) = generate_bedrock_world(&mut partial_chunks, 4); + let ctx = PathfinderCtx::new(&world); let goal = BlockPosGoal(end); - let successors = |pos: BlockPos| successors_fn(&world, pos); + let successors = |pos: BlockPos| successors_fn(&ctx, pos); let astar::Path { movements, partial } = a_star( start, |
