Skip to content

[Deploy preview] Add a function list#5233

Draft
mstange wants to merge 21 commits into
firefox-devtools:mainfrom
mstange:function-list
Draft

[Deploy preview] Add a function list#5233
mstange wants to merge 21 commits into
firefox-devtools:mainfrom
mstange:function-list

Conversation

@mstange

@mstange mstange commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

Deploy preview

WIP implementing the approach outlined in #15 (comment)

@mstange mstange force-pushed the function-list branch 4 times, most recently from 25bc285 to af75e01 Compare April 2, 2026 18:48
@mstange mstange force-pushed the function-list branch 2 times, most recently from 26f8559 to abde12b Compare April 7, 2026 18:28
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.87255% with 441 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.11%. Comparing base (add6b76) to head (5059e16).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/components/calltree/SelfWing.tsx 1.85% 53 Missing ⚠️
src/components/calltree/WingTreeView.tsx 46.93% 52 Missing ⚠️
src/profile-logic/call-node-info.ts 88.03% 36 Missing ⚠️
src/components/shared/WingContextMenu.tsx 79.60% 30 Missing and 1 partial ⚠️
src/profile-logic/flame-graph.ts 84.95% 31 Missing ⚠️
src/components/calltree/LowerWingFlameGraph.tsx 3.33% 29 Missing ⚠️
src/app-logic/url-handling.ts 76.36% 26 Missing ⚠️
src/components/calltree/UpperWingFlameGraph.tsx 31.25% 22 Missing ⚠️
src/reducers/profile-view.ts 73.68% 20 Missing ⚠️
src/selectors/per-thread/stack-sample.ts 84.37% 20 Missing ⚠️
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5233      +/-   ##
==========================================
- Coverage   83.45%   83.11%   -0.35%     
==========================================
  Files         342      351       +9     
  Lines       36075    37859    +1784     
  Branches    10106    10507     +401     
==========================================
+ Hits        30108    31467    +1359     
- Misses       5539     5960     +421     
- Partials      428      432       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mstange added 12 commits June 24, 2026 13:27
It's not used by any TreeView users yet.

The next commit will use it for the marker table.
The intention is to also use it for the function list.
The sort is also persisted in the URL.
This will let us use flame graphs in other places, for example in the
function list panel (for callee / caller views) or in a benchmark
comparison view.

ConnectedFlameGraph is the connected version and works as before.

This commit also removes MaybeFlameGraph. The flame graph no longer respects
the global "is inverted" flag, so the performance warning in MaybeFlameGraph
was never shown. The only other functionality of MaybeFlameGraph was that it
displayed "empty reasons" when the preview selection was empty; this part
has been subsumed into ConnectedFlameGraph.
This lets us build the timing rows lazily, as the flame graph
scrolls them into view.

Building the rows isn't that expensive with the regular flame
graph, but it'll be more expensive for the inverted "calls to
the selected function" icicle flame graph that I'm planning to
add to the function list panel.
This takes advantage of the fact that the flame graph now requests
a row only once it's on the screen.

Note that there's a difference between "FlameGraphRows" and
"FlameGraphTiming" rows.
The FlameGraphRows are still computed eagerly. It's just the timing
that is now computed lazily per displayed row.
The FlameGraphRows are based on the call node info and independent of
sample counts and preview selection.

When switching to the Flame Graph panel on https://share.firefox.dev/4g4xGue ,
with a flame graph canvas height of 564px, I'm getting the following
profiles:
Before: https://share.firefox.dev/4w2QEG3 (410ms tab switch)
After: https://share.firefox.dev/3QYB7IA (272ms tab switch)

In those profiles you can also see the different memory usage characteristics.
… flame graph code.

For the non-inverted call node info, the two are equivalent.

But if we want to use the flame graph on an inverted call node info,
such as for the "called by" view in the function list, the old code
would not work because the callNodeTable is always the non-inverted
call node table. So this change removes one barrier for inverted
flame graphs.
startsAtBottom={true} is the regular flame graph layout.
startsAtBottom={false} can be used for icicle-style flame graphs.
This will be used by the function list when double-clicking on
a function.
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