Skip to content

Make the flame graph and stack chart always non-inverted#4804

Merged
mstange merged 7 commits into
firefox-devtools:mainfrom
mstange:no-inverted-charts
Nov 23, 2023
Merged

Make the flame graph and stack chart always non-inverted#4804
mstange merged 7 commits into
firefox-devtools:mainfrom
mstange:no-inverted-charts

Conversation

@mstange

@mstange mstange commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

Production | Deploy preview

Fixes #3961.
Fixes #4803.

As an added benefit, this simplifies the work for #337 because we won't need special code for the inverted stack chart.

This PR doesn't remove the code for the warning on the flame graph; I'd be happy to leave this cleanup to someone else.

@mstange mstange requested a review from julienw November 21, 2023 01:44
@mstange mstange self-assigned this Nov 21, 2023
@codecov

codecov Bot commented Nov 21, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a3330e8) 88.25% compared to head (57fc8e0) 88.27%.

❗ Current head 57fc8e0 differs from pull request most recent head 3c0c07c. Consider uploading reports for the commit 3c0c07c to get more accurate results

Files Patch % Lines
src/actions/profile-view.js 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4804      +/-   ##
==========================================
+ Coverage   88.25%   88.27%   +0.01%     
==========================================
  Files         301      301              
  Lines       26870    26912      +42     
  Branches     7262     7284      +22     
==========================================
+ Hits        23715    23756      +41     
- Misses       2937     2938       +1     
  Partials      218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julienw julienw left a comment

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.

Thanks, this looks good to me!
I only have one suggestion regarding the caching of the inverted tree. Otherwise a few simple nits.
Tell me what you think :-)

Comment thread src/profile-logic/call-tree.js Outdated
Comment thread src/test/store/actions.test.js
Comment thread src/actions/profile-view.js
Comment thread src/profile-logic/call-tree.js
Comment thread src/selectors/url-state.js
Comment thread src/test/components/FlameGraph.test.js
Comment thread src/test/store/profile-view.test.js Outdated
Comment thread src/components/stack-chart/index.js
Compute the inverted selected call node in the action creator,
not in the reducer. This means we don't have to pass the call tree as
far down.

Also move the computation into the CallTree class.

And fix it to stop at nodes with heaviest self time, even if they're not
leaf nodes.
This means that the flame graph and the stack chart will now always display un-inverted.

Fixes firefox-devtools#3961.
Fixes firefox-devtools#4803.
This makes it faster to switch back and forth between inverted and non-inverted mode.
It also makes it faster to switch tabs between inverted call tree and the chart views
which are always non-inverted.
@mstange mstange enabled auto-merge November 23, 2023 21:14
@mstange mstange merged commit efbe020 into firefox-devtools:main Nov 23, 2023
@julienw julienw mentioned this pull request Dec 5, 2023
mstange added a commit to mstange/perf.html that referenced this pull request Aug 6, 2024
The stack chart is now always inverted. I forgot to remove this test in firefox-devtools#4804.
mstange added a commit to mstange/perf.html that referenced this pull request Aug 6, 2024
The stack chart is now always non-inverted. I forgot to remove this test in firefox-devtools#4804.
mstange added a commit to mstange/perf.html that referenced this pull request Aug 7, 2024
The stack chart is now always non-inverted. I forgot to remove this test in firefox-devtools#4804.
mstange added a commit that referenced this pull request Aug 7, 2024
The stack chart is now always non-inverted. I forgot to remove this test
in #4804.
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.

Consider making the stack chart always non-inverted Flame graph should display when the call tree is inverted

2 participants