Modify bench-profile to allow generating better flamegraphs

With these settings I can see much more clearly which functions
are major contributors in flamegraphs -- using default profile
has heavy inlining which obfuscates things.
This commit is contained in:
Jussi Saurio
2025-12-30 14:20:49 +02:00
parent 1bceb27ab5
commit 6e6be4dc28
2 changed files with 4 additions and 2 deletions

View File

@@ -140,14 +140,14 @@ cargo tarpaulin -o html
Run benchmarks:
```console
cargo bench
cargo bench --profile bench-profile --bench benchmark
```
Run benchmarks and generate flamegraphs:
```console
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
cargo bench --bench benchmark -- --profile-time=5
cargo bench --profile bench-profile --bench benchmark -- --profile-time=5
```
## Debugging bugs

View File

@@ -126,6 +126,8 @@ lto = true
[profile.bench-profile]
inherits = "release"
debug = true
lto = false # LTO hides function boundaries
codegen-units = 16 # Less cross-unit inlining
[profile.dist]
inherits = "release"