Overview
Add a feature-gated allocation counter on the hot path (ingest → execution report) to measure and report allocation count. Use a wrapper allocator or counters to identify unnecessary allocations. Gate behind feature = "alloc-counters" to avoid production overhead.
Context
- Files:
Cargo.toml, src/lib.rs, src/orderbook/operations.rs
- Worktest requirement: "Allocation count on the hot path (should be zero or near-zero)"
- Signal: staff-level engineering; zero-alloc paths are rare but valuable
- Optional: CPU pinning to reduce variance
Acceptance criteria
Overview
Add a feature-gated allocation counter on the hot path (ingest → execution report) to measure and report allocation count. Use a wrapper allocator or counters to identify unnecessary allocations. Gate behind
feature = "alloc-counters"to avoid production overhead.Context
Cargo.toml,src/lib.rs,src/orderbook/operations.rsAcceptance criteria
cargo clippy --all-targets --all-features -- -D warningscleancargo fmt --all --checkcleancargo test --all-featurescleancargo build --releasecleancargo test --all-features --test '*alloc*'runs without errortest_ingest_zero_allocconfirms allocation count ≤ expected threshold