tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.29k stars 99 forks source link

Fork `backtrace-rs` and modify MAPPINGS_CACHE_SIZE to `10` #184

Open hehechen opened 1 year ago

hehechen commented 1 year ago

The overhead of dwarf resolving symbol is larger than that of frame pointer. The root cause is that the backtrace of DWARF is deeper than that of frame pointer. So DWARF need to resolve more shared libraries when resolving symbols. But the capacity of lib cache in backtrace-rs is only 4, so cache miss will occurs frequently in DWARF scenarios. I created a PR to make MAPPINGS_CACHE_SIZE configurable , but it has not been discussed and merged. I think we can fork backtrace-rs and modify MAPPINGS_CACHE_SIZE to 10.