Skip to content

Phase 7.2: Benchmark suite — profile-off / on-inactive / on-active - #22

Merged
jayakasadev merged 1 commit into
mainfrom
feature/phase-7-2-bench-suite
Jun 11, 2026
Merged

jayakasadev merged 1 commit into
mainfrom
feature/phase-7-2-bench-suite

Conversation

@jayakasadev

Copy link
Copy Markdown
Owner

Summary

Criterion-based benchmark suite to measure SNMALLOC_PROFILE=ON overhead.

  • 3 groups × 3 variants:
    • groups: small_allocs (32B), medium_allocs (4KB), mixed (random 16..16384)
    • variants: profile-off, profile-on-inactive (set_sampling_rate(usize::MAX)), profile-on-active (default 524288)
  • Dev-dep: criterion = { version = "0.5", default-features = false } (no HTML report — JSON estimates only, keeps dep weight down)
  • Hand-rolled main() — final stderr summary points to target/criterion/**/estimates.json and prints ratio_idle = mean(profile-on-inactive) / mean(profile-off) (the metric CI is expected to gate on)
  • No #[global_allocator] wired — sampling-rate FFI is process-global; we measure variant-to-variant relative overhead, not absolute throughput vs system malloc
  • Optional benches/README.md included with run instructions

Test plan

  • cargo build (no features)
  • cargo test (no features) — full suite green
  • cargo bench --no-run (no features + --features profiling) — compiles clean

Note: actual cargo bench runs take minutes — deferred to reviewer / CI.

- benches/profile_bench.rs: three groups (small_allocs 32B,
  medium_allocs 4K, mixed 16..16384) x three variants
  (profile-off, profile-on-inactive at usize::MAX rate,
  profile-on-active at 512 KiB default rate). Hand-rolled main
  emits a stderr summary pointing at the ratio_idle metric used
  by CI to gate idle overhead at <= 5%.
- Cargo.toml: criterion 0.5 (no default features) as a dev-dep,
  [[bench]] entry with harness = false.
- benches/README.md: short doc on running, what ratio_idle means,
  why absolute numbers are host-specific.
@jayakasadev
jayakasadev merged commit b59c906 into main Jun 11, 2026
155 of 202 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant