Docs: clarify MemoryManager usage#2185
Conversation
| benchmark::RegisterMemoryManager(&mm); | ||
| benchmark::Initialize(&argc, argv); | ||
| benchmark::RunSpecifiedBenchmarks(); | ||
| benchmark::RegisterMemoryManager(nullptr); |
| public: | ||
| void Start() override {} | ||
|
|
||
| void Stop(Result& result) override { |
There was a problem hiding this comment.
is this a helpful example? it's a bit of a toy, but i think the complexity of using the memory manager is not in this interface, but in how to use it alongside something like tcmalloc.
maybe this should be an expanded tutorial on how to use it in its own documentation instead of this (what i consider fairly obvious) interface documentation.
5b59cd7 to
4536d7a
Compare
|
Makes sense. I removed the toy example and replaced it with a shorter note that MemoryManager only bridges allocator or profiler data into JSON, with a pointer to custom counters for console/CSV or allocator-specific columns. |
| activity. Reset that collector in `Start()`, then copy its final counters into | ||
| `MemoryManager::Result` in `Stop()`. | ||
|
|
||
| Use [Custom Counters](#custom-counters) instead when memory stats need to be |
There was a problem hiding this comment.
no don't do this. we have the memory manager for exactly this reason. this would encourage users to run memory profiling in their performance sensitive micro benchmarks.
i don't think this PR is very useful.
|
Fair point. I'll close this then. Thanks for taking a look. |
Adds a small MemoryManager registration example to the user guide.\n\nRefs #1217