Add arena debug visualization tool

This commit is contained in:
2025-08-15 11:25:10 -04:00
parent 28fa96011f
commit f1794bcb3e
6 changed files with 576 additions and 24 deletions

View File

@@ -92,26 +92,6 @@ int main() {
});
}
// Memory allocation efficiency benchmarks
auto memory_bench = ankerl::nanobench::Bench()
.title("CommitRequest Memory Usage")
.unit("allocation")
.warmup(50);
// Different arena sizes
for (size_t arena_size : {1024, 4096, 16384, 65536}) {
memory_bench.run(
"Arena size " + std::to_string(arena_size) + " bytes", [&] {
CommitRequest request(arena_size);
std::string mutable_json = COMPLEX_JSON;
bool result =
request.parse_json(mutable_json.data(), mutable_json.size());
ankerl::nanobench::doNotOptimizeAway(result);
ankerl::nanobench::doNotOptimizeAway(request.total_allocated());
ankerl::nanobench::doNotOptimizeAway(request.used_bytes());
});
}
// Reset and reuse benchmarks
auto reuse_bench = ankerl::nanobench::Bench()
.title("CommitRequest Reset and Reuse")