refactor: drop spent ablation knobs from perf spike, trim ADR-0002 consequences

This commit is contained in:
2026-08-10 15:07:36 +02:00
parent 68a587b948
commit 6e1df29364
2 changed files with 5 additions and 23 deletions

View File

@@ -16,8 +16,6 @@
//! PERF_N enemy population held constant (default 1000)
//! PERF_FIRE_RATE tower shots per second (default 20)
//! PERF_RENDER 1 = window + sprites, 0 = headless logic (default 1)
//! PERF_COLLIDE 1 = run naive O(n*m) collision (default 1)
//! PERF_MOVE 1 = run enemy movement (default 1)
//! PERF_SECONDS length of the measurement window (default 12)
//! PERF_WARMUP seconds discarded before measuring (default 4)
//!
@@ -48,7 +46,7 @@ const HIT_RADIUS: f32 = 10.0;
/// An enemy this close to the centre has "arrived" and is recycled to the rim.
const CENTER_RADIUS: f32 = 24.0;
/// Enough history to hold every frame of a long run at high fps.
const HISTORY: usize = 120_000;
const HISTORY: usize = 20_000;
const D_MAINTAIN: DiagnosticPath = DiagnosticPath::const_new("spike/maintain_us");
const D_MOVE_ENEMIES: DiagnosticPath = DiagnosticPath::const_new("spike/move_enemies_us");
@@ -64,8 +62,6 @@ struct SpikeConfig {
enemy_count: usize,
fire_rate: f32,
render: bool,
collide: bool,
move_enemies: bool,
warmup_secs: f64,
measure_secs: f64,
}
@@ -77,8 +73,6 @@ impl SpikeConfig {
enemy_count: cli_n.unwrap_or_else(|| env_num("PERF_N", 1000.0) as usize),
fire_rate: env_num("PERF_FIRE_RATE", 20.0) as f32,
render: env_flag("PERF_RENDER", true),
collide: env_flag("PERF_COLLIDE", true),
move_enemies: env_flag("PERF_MOVE", true),
warmup_secs: env_num("PERF_WARMUP", 4.0),
measure_secs: env_num("PERF_SECONDS", 12.0),
}
@@ -183,10 +177,10 @@ fn main() {
Update,
(
maintain_population,
move_enemies.run_if(|c: Res<SpikeConfig>| c.move_enemies),
move_enemies,
tower_fire,
move_projectiles,
collide.run_if(|c: Res<SpikeConfig>| c.collide),
collide,
)
.chain(),
)
@@ -441,10 +435,6 @@ fn harness(
);
println!("N (enemies) {}", cfg.enemy_count);
println!("fire rate {} shots/s", cfg.fire_rate);
println!(
"systems move={} collide={}",
cfg.move_enemies, cfg.collide
);
println!("frames measured {frames}");
println!(
"frame time median {median_ms:.3} ms | p95 {p95_ms:.3} ms | p99 {p99_ms:.3} ms"