nvzqz / divan

Fast and simple benchmarking for Rust projects
https://nikolaivazquez.com/blog/divan/
Apache License 2.0
849 stars 24 forks source link

Profile allocations in benchmarks #40

Closed nvzqz closed 7 months ago

nvzqz commented 7 months ago

This adds AllocProfiler, an allocator implementation that tracks the number of allocations and bytes allocated during benchmarks. It can wrap any GlobalAlloc, such as mimalloc.

Example benchmark output: Screen Shot 2023-12-11 at 05 34 17

nvzqz commented 7 months ago

I believe I've pored over this code enough to be convinced that it's correct, so I'm going to merge it. Also, I can't come up with ways to make it faster without spending much more time.