perf(game): eliminate per-event allocations via ScratchArena
Game::likelihoods previously allocated four Vecs (teams, diffs, ties, margins) on every call. Batch now owns one ScratchArena reused across all Game::new calls in the iteration loop; likelihoods() clears and extends the arena buffers instead of allocating fresh. For log_evidence (called infrequently), a local ScratchArena is created per invocation so the method signature stays &self. Also: add #[derive(Debug)] to TeamMessage and DiffMessage (required by ScratchArena's own Debug derive). Part of T0 engine redesign.
This commit is contained in:
@@ -9,6 +9,7 @@ use std::{
|
||||
pub mod agent;
|
||||
#[cfg(feature = "approx")]
|
||||
mod approx;
|
||||
pub(crate) mod arena;
|
||||
pub mod batch;
|
||||
pub mod drift;
|
||||
mod error;
|
||||
|
||||
Reference in New Issue
Block a user