paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.77k stars 634 forks source link

Subsystem benchmark memory profiling #5425

Open sandreim opened 3 weeks ago

sandreim commented 3 weeks ago

It would be great to have this working along with CPU profiling. We could use it to investigate performance as well as memory leaks.

AndreiEres commented 3 weeks ago

We profile cache misses using valgrind. Could add more reports using other instruments from valgrind. But what exactly we need and for which cases?

sandreim commented 3 weeks ago

Recently, @alexggh has played with profiling the amount of memory is allocated in different calls which lead to discovering some improvement opportunities. jemalloc has a profiling feature that allows it, but Alex can share more details about how we could automate as much as possible what he did.

alexggh commented 3 weeks ago

These are the steps that I've been playing with: https://www.magiroux.com/rust-jemalloc-profiling/, I'll follow with a PR to integrate it in subsystem-bench.

Most likely the same thing would have been achieved with valgrind instrumentation.