Commits


Will Jones authored and GitHub committed ddfa8eed9b1
GH-15231: [C++][Benchmarking] Add new memory pool metrics and track in benchmarks (#33731) ### Rationale for this change We would like to track memory usage in many of our benchmarks. In order to isolate memory metrics per benchmark, we pass in a new `ProxyMemoryPool` to each benchmark, and collect the metrics from that at the conclusion of each benchmark. This only works for benchmarks where there are no allocations that bypass the passed pool and instead use the `default_memory_pool()`. Unfortunately most do right now, so this is only enabled for two benchmarks: builders and CSV converter. ### What changes are included in this PR? * `MemoryPool` now tracks both `num_allocations` and `total_bytes_allocated`. * There is now a class `BenchmarkMemoryTracker` which can be instantiated in benchmark files to get access to the `ProxyMemoryPool` that takes measurements and saves them to Google benchmark. * Wired up memory tracking to `arrow-csv-converter-benchmark` and `arrow-builder-benchmark` ### Are these changes tested? * [x] Add tests ### Are there any user-facing changes? * [x] Validate performance impact of new metrics in memory pools. No breaking changes. * Closes: #15231 Authored-by: Will Jones <willjones127@gmail.com> Signed-off-by: Will Jones <willjones127@gmail.com>