Skip to content

feat(dash-spv-bench): opt-in in-process CPU and heap profiling, client always in docker - #1022

Closed
ZocoLini wants to merge 2 commits into
devfrom
feat/bench-memory-snapshot
Closed

ZocoLini wants to merge 2 commits into
devfrom
feat/bench-memory-snapshot

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

…t always in docker

`./run.sh <scenario> --flame` builds the bench with the `cpu-profile`
feature (pprof, 99 Hz SIGPROF sampler) and writes flamegraph.svg.
`--memory-snapshot` builds with `heap-profile` (jemalloc as the global
allocator, sampling heap profiling) and writes heap-peak.svg: the live
heap at the highest RSS of the run. A thread re-dumps the profile each
time VmRSS grows by 5 % and only the last dump is rendered, after the
sync. Without the flags neither profiler is compiled in. perf is not
usable on the benchmark host (perf_event_paranoid=4) nor reliably under
Docker Desktop, and jeprof needed path and placeholder workarounds, so
both profilers now run inside the process.

peak_rss_mib is read before the profiles are rendered: rendering the
CPU flamegraph of a 20-minute run allocates ~2 GB, which otherwise
showed up as a 4703 MiB peak and filled half of the heap snapshot.

The client now always runs in the client container, shaped or not, and
the binary is always built inside the Rust image, so it links against
the container's glibc (a host build fails to start on hosts with a
newer glibc than bookworm's). This drops the host-run path, the
perf/perl/FlameGraph/OS checks and the policer fallback for kernels
without ifb: a run whose download rate cannot be enforced now fails
instead of producing a result that cannot be compared. `--wallets` with
a relative path now resolves against the caller's directory instead of
dash-spv-bench/. run.sh goes from 664 to 366 lines.

Mainnet restore, mainnet.100mbi.100ms, on dev, --flame
--memory-snapshot: 20.3 min, peak_rss_mib 2280, heap snapshot at
2243 MiB RSS (1.88 GB live), 14114383 sat, 13389 addresses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DruChNTWXwJoWPartZwCf
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.22%. Comparing base (350f5f7) to head (0b2d947).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1022      +/-   ##
==========================================
- Coverage   77.23%   77.22%   -0.01%     
==========================================
  Files         329      329              
  Lines       83862    83862              
==========================================
- Hits        64768    64764       -4     
- Misses      19094    19098       +4     
Flag Coverage Δ
core 78.24% <ø> (ø)
ffi 50.95% <ø> (+<0.01%) ⬆️
rpc 20.00% <ø> (ø)
spv 92.14% <ø> (-0.03%) ⬇️
wallet 79.79% <ø> (ø)
see 6 files with indirect coverage changes

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DruChNTWXwJoWPartZwCf
@ZocoLini

Copy link
Copy Markdown
Collaborator Author

see #1024

@ZocoLini ZocoLini closed this Sep 15, 2026
@ZocoLini
ZocoLini deleted the feat/bench-memory-snapshot branch September 15, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant