Skip to content

Add dhat? #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kcaffrey opened this issue Dec 6, 2023 · 1 comment
Closed

Add dhat? #51

kcaffrey opened this issue Dec 6, 2023 · 1 comment

Comments

@kcaffrey
Copy link
Contributor

kcaffrey commented Dec 6, 2023

I added dhat to my repo (which was generated from the template), so that I can run and get output like the following:

$ cargo solve 5 --dhat
    Finished dhat [optimized + debuginfo] target(s) in 0.01s
     Running `target/dhat/05`
dhat: Total:     23,920 bytes in 244 blocks
dhat: At t-gmax: 8,176 bytes in 12 blocks
dhat: At t-end:  0 bytes in 0 blocks
dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_view.html
Part 1: 382895070 (6.2ms)
dhat: Total:     32,528 bytes in 307 blocks
dhat: At t-gmax: 8,384 bytes in 11 blocks
dhat: At t-end:  0 bytes in 0 blocks
dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_view.html
Part 2: 17729182 (4.2ms)

Do you have any interest in getting this upstream? I'm not sure how many people would care to use it. I was mainly curious about optimizing allocations in various computations (e.g. using custom iterators instead of allocating vectors for temporary results) as a learning experience, so I found it useful to be able to see what's going on in the memory allocator.

@fspoettel
Copy link
Owner

This is cool, I would actually be interested in that myself. If I read it correctly, the whole thing is behind a feature flag? That would be perfect then, and a PR appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants