chore: more fixes
This commit is contained in:
1 parent
37437ee0a0
commit
6eb02f65b9
166 files changed
+1681
-1520
No files matched your search
@@ -1,57 +1,30 @@
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
use pumpkin_data::{
|
||||
chunk_gen_settings::GenerationSettings, dimension::Dimension,
|
||||
noise_router::OVERWORLD_BASE_NOISE_ROUTER,
|
||||
};
|
||||
use pumpkin_world::{
|
||||
GlobalRandomConfig, ProtoNoiseRouters, bench_create_and_populate_biome,
|
||||
bench_create_and_populate_noise, bench_create_and_populate_noise_with_surface,
|
||||
generation::proto_chunk::TerrainCache,
|
||||
GlobalRandomConfig, bench_create_and_populate_biome, bench_create_and_populate_noise,
|
||||
bench_create_and_populate_noise_with_surface,
|
||||
};
|
||||
|
||||
fn bench_terrain_gen(c: &mut Criterion) {
|
||||
let seed = 0;
|
||||
let random_config = GlobalRandomConfig::new(seed, false);
|
||||
let base_router = ProtoNoiseRouters::generate(&OVERWORLD_BASE_NOISE_ROUTER, &random_config);
|
||||
let surface_config = GenerationSettings::from_dimension(&Dimension::OVERWORLD);
|
||||
let terrain_cache = TerrainCache::from_random(&random_config);
|
||||
let default_state = surface_config.default_block;
|
||||
|
||||
c.bench_function("overworld biome", |b| {
|
||||
b.iter(|| {
|
||||
bench_create_and_populate_biome(
|
||||
&base_router,
|
||||
&random_config,
|
||||
surface_config,
|
||||
&terrain_cache,
|
||||
default_state,
|
||||
);
|
||||
bench_create_and_populate_biome(&random_config);
|
||||
});
|
||||
});
|
||||
|
||||
c.bench_function("overworld noise", |b| {
|
||||
b.iter(|| {
|
||||
bench_create_and_populate_noise(
|
||||
&base_router,
|
||||
&random_config,
|
||||
surface_config,
|
||||
&terrain_cache,
|
||||
default_state,
|
||||
);
|
||||
bench_create_and_populate_noise(&random_config);
|
||||
});
|
||||
});
|
||||
|
||||
c.bench_function("overworld surface", |b| {
|
||||
b.iter(|| {
|
||||
bench_create_and_populate_noise_with_surface(
|
||||
&base_router,
|
||||
&random_config,
|
||||
surface_config,
|
||||
&terrain_cache,
|
||||
default_state,
|
||||
);
|
||||
bench_create_and_populate_noise_with_surface(&random_config);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user