flashbots / rbuilder

rbuilder is a blazingly fast, state of the art Ethereum MEV-Boost block builder written in Rust
Apache License 2.0
186 stars 21 forks source link

test(bench): Playing with flamegraph generation [wip] #8

Open metachris opened 2 weeks ago

metachris commented 2 weeks ago

πŸ“ Summary

Trying to integrate flamegraph generation for the benchmarks (using flamegraph-rs and pprof-rs):

This setup uses the pprof-rs Flamegraph-Profiler for Criterion. Note: Custom profilers are only executed when passing a --profile-time argument (see also the relevant Criterion docs).

Flamegraphs can be generated for benchmarks with this command:

$ make bench-flamegraphs 

Curiously, trying to generate flamegraphs for the SSZ encoding benchmark causes a segfault:

$ cargo bench --bench bench_flamegraphs -- --profile-time 3

[...]

Benchmarking MEV-Boost SubmitBlock serialization/SSZ encoding: Profiling for 3.0000 serror: bench failed, to rerun pass `--bench bench_flamegraphs`

Caused by:
  process didn't exit successfully: `/Users/metachris/Projects/2024/rbuilder-private/target/release/deps/bench_flamegraphs-9f5a78747b3c4349 --profile-time 3 --bench` (signal: 5, SIGTRAP: trace/breakpoint trap)
That's why the flamegraph benchmarks are separated into bench_flamegraphs for now.

πŸ’‘ Motivation and Context

It would be amazing to have meaningful flamegraphs.


βœ… I have completed the following steps:

github-actions[bot] commented 2 weeks ago

Benchmark results for 7688350

Report: https://flashbots-rbuilder-ci-stats.s3.us-east-2.amazonaws.com/benchmark/7688350-27a8867/report/index.html

Date (UTC) 2024-07-03T12:07:28+00:00
Commit 7688350e20a7c475e1fbc9134ab757a1b7b3faf3
Base SHA 27a8867ad82b64230ce21dc6e0866c3599f10fbd

Significant changes

None