Skip to content

Commit

Permalink
Increase default flamegraph fidelity
Browse files Browse the repository at this point in the history
See also jonhoo#153. PR jonhoo#136 changed the semantics of the `--minwidth` option
from output pixel width to percentage width (which is effectively the
same as pct of total samples), which greatly reduced the default
fidelity of flamegraphs as 0.1% of total time is quite coarse,
especially once you start zooming in.

This PR reduces the default to 0.01%, which produces pretty much
identical output as flamegraph.pl / old inferno at ~1200px wide and
includes a much greater number of bars. I think this change is worth
making as it makes it reduces friction for people migrating from
flamegraph.pl, and in my tests produces much more useful output by
default.

I've also updated the description of the option to match the current
behaviour, as it still mentioned pixels and that had me confused for
a good while.
  • Loading branch information
asherkin committed Dec 28, 2020
1 parent 2e07925 commit a69457e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support jit annotations in collapse-perf for runtimes using the jitdump format. [#202](https://github.com/jonhoo/inferno/pull/202)

### Changed
- Decreased default minimum width from 0.1% to 0.01%. [#204](https://github.com/jonhoo/inferno/pull/204)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/bin/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct Opt {
)]
height: usize,

/// Omit functions smaller than <FLOAT> pixels
/// Omit functions smaller than <FLOAT> percent
#[structopt(
long = "minwidth",
default_value = &defaults::str::MIN_WIDTH,
Expand Down
2 changes: 1 addition & 1 deletion src/flamegraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub mod defaults {
TITLE: &str = "Flame Graph",
CHART_TITLE: &str = "Flame Chart",
FRAME_HEIGHT: usize = 16,
MIN_WIDTH: f64 = 0.1,
MIN_WIDTH: f64 = 0.01,
FONT_TYPE: &str = "Verdana",
FONT_SIZE: usize = 12,
FONT_WIDTH: f64 = 0.59,
Expand Down

0 comments on commit a69457e

Please sign in to comment.