Skip to content

Conversation

@taj-p
Copy link
Contributor

@taj-p taj-p commented Dec 31, 2025

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:

image

@taj-p taj-p added the C-cpu Applies to the vello_cpu crate label Dec 31, 2025
Copy link
Collaborator

@grebmeg grebmeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@LaurenzV
Copy link
Collaborator

Not opposing having this, but in case you didn't know, you can also trace allocations using Apple Instruments! Here is an example how it looks like:
image

@grebmeg
Copy link
Collaborator

grebmeg commented Jan 13, 2026

Not opposing having this, but in case you didn't know, you can also trace allocations using Apple Instruments! Here is an example how it looks like:

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 supports this, but I’m not sure whether dhat is planned to be used for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cpu Applies to the vello_cpu crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants