Conversation
grebmeg
left a comment
There was a problem hiding this comment.
Great to see this! I tried the PR and was able to get some useful data that should be actionable for analyzing potential issues, so I’m definitely in favor of this. My only concern is that the crate is experimental and doesn’t appear to be actively maintained, but as long as it continues to work and provide valuable insights, I think it’s fine to include it here.
[nit]: maybe we can add dhat-heap.json to .gitignore?
Thank you for sharing, this is nice tooling! Especially on M4 or later devices, where you can analyze CPU usage using Processor Trace. I think there’s also the idea of writing tests that verify a certain piece of code performs a specific amount of heap allocation when it runs. |

DHAT provides allocation statistics with full stack traces which is useful for identifying allocation hot spots.
For example, see how 20% of all allocations from this example trace occur from pushing commands into a wide tile: