bench(profiling): measure live heap tracking paths#4045
bench(profiling): measure live heap tracking paths#4045realFlowControl wants to merge 3 commits into
Conversation
e954bcf to
b13f0d3
Compare
|
Benchmarks [ profiler ]Benchmark execution time: 2026-07-17 11:16:44 Comparing candidate commit 9a0cf90 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 28 metrics, 8 unstable metrics.
|
Description
This PR extracts the existing heap-live map and count into
LiveHeapTracker<T>and routes the existing thread-local allocation state throughLocalLiveHeapTrackerwithout changing behavior. The Criterion benchmark compiles and calls these productiontrackanduntrackmethods directly, without linking a PHP executable.The fixture keeps 2,048 32-byte samples in the tracker and rotates eight-byte-aligned target addresses through the same application pages. It times batches of 256 production calls so fixture mutation and per-operation timer overhead are excluded. The three measured paths are adding a tracked allocation, freeing a tracked allocation, and freeing an untracked allocation.
Run it with
cargo bench -p datadog-php-profiling --bench heap_live_tracking.DashMap-only baseline on an Apple M4 Max:
allocate_tracked: 5.484–5.504 nsfree_tracked: 5.512–5.539 nsfree_untracked: 2.634–2.651 nsValidation performed: profiler Rust unit tests passed (22 tests), profiler clippy passed with the unrelated pre-existing
got_macho.rslint suppressed, and the benchmark completed successfully.Reviewer checklist