Skip to content

Visualization options for easier viewing#345

Open
willhansen wants to merge 2 commits intojonhoo:mainfrom
clearpathrobotics:main
Open

Visualization options for easier viewing#345
willhansen wants to merge 2 commits intojonhoo:mainfrom
clearpathrobotics:main

Conversation

@willhansen
Copy link

@willhansen willhansen commented Jul 3, 2025

Add four new options:

  • --include-children

    • When present, each frame of a differential flamegraph will be coloured according to the sum of all of that frame's children
    • Very useful when many small functions collectively impact performance
  • --frame-width-source

    • Chooses the frame widths of differential frame graphs, removing need to generate two different graphs every time
    • Possible values (taking A and B as the first and second sample counts for each stack):
      • before: A
      • after: B
      • difference: abs(A-B)
      • common: min(A, B)
      • all-samples: A+B
      • max: max(A, B)
  • --detailed-tooltips

    • Provides more information in the tooltips of differential flamegraphs
  • --normalize

    • Normalizes each stack sample count so that the total sample count of the two measurements does not interfere with comparison
    • Unlike the stack diff tool, uses floating point numbers to better handle single sample stacks

Add nix flake for dev shell

    --include-children
       - When present, each frame of a differential flamegraph will be
         coloured according to the sum of all of that frame's children
       - Very useful when many small functions collectively impact
         performance

    --frame-width-source
       - Chooses the frame widths of differential frame graphs, removing
         need to generate two different graphs every time
       - Possible values (taking A and B as the first and second sample
         counts for each stack):
          - "before":     A
          - "after":      B
          - "difference": abs(A-B)
          - "common":     min(A, B)
          - "allsamples": A+B
          - "max":        max(A, B)

    --detailed-tooltips
       - Provides more information in the tooltips of differential
         flamegraphs

    --normalize
       - Normalizes each stack sample count so that the total sample count of the
         two measurements does not interfere with comparison
       - Unlike the stack diff tool, uses floating point numbers
         to better handle single sample stacks

Add nix flake for dev shell
Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I'm not opposed to any of these changes necessarily, though it's very hard to review this with four different features (five when you count nix) all intermingled in the same PR. Could you instead please open a dedicated PR for each PR?

};
if opt.negate_differentials {
delta_pct_pt = -delta_pct_pt;
// std::mem::swap(&mut frame_count_before, &mut frame_count_after);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be leftover from debugging?

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.

2 participants