Skip to content

refactor(devtools): improve profiler ux - #70102

Open
hawkgs wants to merge 2 commits into
angular:mainfrom
hawkgs:devtools/profiler-improvements
Open

refactor(devtools): improve profiler ux#70102
hawkgs wants to merge 2 commits into
angular:mainfrom
hawkgs:devtools/profiler-improvements

Conversation

@hawkgs

@hawkgs hawkgs commented Aug 6, 2026

Copy link
Copy Markdown
Member

One of the goals of this change is to make the Profiler more welcoming to new users of Angular DevTools.

Changes:

  • Add info tooltips that describe the visualizations and other parts of the UI
  • Improve the frame selector by adding axes labels and a horizontal line for frames exceeding 60 fps
  • Use a precise frame rate calculations instead of approximations
  • Introduce improvements to the details panel
  • Improve the bar chart visualization
  • And more
Screenshot 2026-08-06 at 16 05 04

- Add info tooltips that describe the visualizations and other
parts of the UI
- Improve the frame selector by adding axes labels and a
horizontal line for frames exceeding 60 fps
- Use a precise frame rate calculations instead of approximations
- Introduce improvements to the details panel
- Improve the bar chart visualization
- And more
@ngbot ngbot Bot added this to the Backlog milestone Aug 6, 2026

@JeanMeche JeanMeche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM on the feature itself, it's a welcomed improvement.

@pullapprove
pullapprove Bot requested a review from josephperrott August 7, 2026 10:04
@hawkgs

hawkgs commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Along with the addressed comments, the fixup includes an ngx-flamegraph version bump (Note: The lib was added to the minimumReleaseAgeExclude list since the release is less than a day old Will delay the merge by 24h instead; adding state: blocked).

It converts the HSL flamegraph colors to RGB, since HSL produces very distinct bar colors in our profiler when we don't have a great variety of values to render, which makes it hard to notice a tendency in the coloring. This is because HSL color transition goes through all colors in the spectrum between the selected min and max, whereas RGB does a gradual transition between the two. You can check more about the change along with a visual example in this PR: mgechev/ngx-flamegraph#69

@hawkgs
hawkgs force-pushed the devtools/profiler-improvements branch from 620fcfa to 68e4879 Compare August 7, 2026 10:22
@JeanMeche
JeanMeche removed the request for review from josephperrott August 7, 2026 11:02
@pullapprove
pullapprove Bot requested a review from josephperrott August 7, 2026 11:02
@extend %caption-text;
margin: 0;
color: var(--quaternary-contrast);
white-space: norwrap;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Typo in white-space value. It should be nowrap instead of norwrap.

@@ -24,6 +24,9 @@ export interface FlamegraphNode {
export const ROOT_LEVEL_ELEMENT_LABEL = 'Entire application';

export class FlamegraphFormatter extends RecordFormatter<FlamegraphNode> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider: Avoid storing transient state like cdColor and noCdColor as class properties in FlamegraphFormatter. They are only used during formatFrame execution. Consider passing them as arguments to addFrame or refactoring addFrame to be a local function inside formatFrame to maintain purity.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, on a second look, the change doesn't seem good.

[VisualizationMode.BarGraph]:
'The bar chart displays the processing time of the components during the selected CD cycle(s) in descending order.',
[VisualizationMode.FlameGraph]:
'The flame graph displays the full component tree hierarchy for the selected cycle(s). During this period, processed components shift from blue to orange. The more orange a component is, the longer it took to process. You can expand and explore deeply nested nodes by double-clicking a bar.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: "more orange" is a bit awkward language, maybe "closer to orange" might be a little more accurate? Not sure there is a great phrasing option here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants