nnethercote / dhat-rs

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

Use `entry()` instead of get() and insert() #7

Closed jyn514 closed 3 years ago

jyn514 commented 3 years ago

This avoids hashing the backtrace twice the first time it's constructed, which should almost double the performance. I do not have benchmarks to back this up.

meta: DHAT has slowed down rustdoc by a factor of almost 30, and it wasn't fast to start. It would be great to improve the performance of DHAT in general.

jyn514 commented 3 years ago

Ah ok, that makes sense. I'll revert the change - I think the first commit should be valid though.

nnethercote commented 3 years ago

An equivalent change was made in #3.