Skip to content

feat: write_flamegraph defaults to symbolicated output - #71

Merged
jayakasadev merged 1 commit into
mainfrom
feat/write-flamegraph-symbolicated-default
Jun 16, 2026
Merged

jayakasadev merged 1 commit into
mainfrom
feat/write-flamegraph-symbolicated-default

Conversation

@jayakasadev

Copy link
Copy Markdown
Owner

What: Make HeapProfile::write_flamegraph dispatch to the symbolicated rendering when symbolicate is on; rename the existing raw-hex API to write_flamegraph_raw (always available); demote write_flamegraph_symbolized to a private write_flamegraph_symbolicated_inner impl detail. Bumps snmalloc-rs 0.7.4 -> 0.8.0 (breaking).

Why: Every interactive viewer (flamegraph.pl, inferno, speedscope) is dramatically more useful with named frames than with raw hex addresses. Making symbolicated the default for the canonical entrypoint matches user expectations; raw-hex remains one method call away (write_flamegraph_raw) for external-symbolicator workflows or stable golden output.

Cost: Breaking API rename. The raw call site moves from write_flamegraph to write_flamegraph_raw, and the symbolicated entrypoint moves from write_flamegraph_symbolized to write_flamegraph. No runtime cost in non-symbolicate builds (the dispatcher reduces to the raw path via cfg).

Evidence: cargo build -p snmalloc-rs --features profiling and cargo build -p snmalloc-rs --features profiling,symbolicate both clean. cargo test -p snmalloc-rs --features profiling --lib 35/35 pass, --features profiling,symbolicate --lib 40/40 pass, --test profile_symbolize 2/2 pass. cargo build -p snmalloc-tools clean (verifies workspace consumer still builds against new API). Ticket: 86aj2dwjz. Local verification only (fork CI disabled).

Rename existing public write_flamegraph to write_flamegraph_raw
(always-available raw-hex rendering), make the existing
write_flamegraph_symbolized a private impl detail
(write_flamegraph_symbolicated_inner), and introduce a new
write_flamegraph dispatcher that selects the symbolicated path
when the `symbolicate` feature is on and the raw path otherwise.

Bumps snmalloc-rs to 0.8.0 (breaking: the raw-rendering call site
moves from write_flamegraph to write_flamegraph_raw, and the
symbolicated entrypoint moves from write_flamegraph_symbolized to
write_flamegraph). Updates README example and integration test.

Ticket: 86aj2dwjz.
@jayakasadev
jayakasadev merged commit 3fa7ebd into main Jun 16, 2026
@jayakasadev
jayakasadev deleted the feat/write-flamegraph-symbolicated-default branch June 16, 2026 15:49
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