nnethercote / dhat-rs

Heap profiling and ad hoc profiling for Rust programs.
Apache License 2.0
744 stars 36 forks source link

advise to use custom profile in crate docs #26

Open kraktus opened 1 year ago

kraktus commented 1 year ago

Hey, thanks for the great crate. I've been using it extensively for my project.

One thing I'd highlight in the doc is the use of a custom profile in the cargo manifest:

[profile.dhat] # for profiling only # dhat
inherits = "release"
debug = 1

As enabling debug for release builds otherwise increase the final binary size. This goes well with having a feature to enable dhat, and you can even add a cargo alias in project/.cargo/config.toml to get both running easily.

dhat = "run --profile dhat --features dhat --"

Since this is rather a style point I didn't make a PR but rather an issue