Skip to content

Always render the CPU-usage-aware activity graph when CPU information is available#5918

Merged
mstange merged 3 commits intofirefox-devtools:mainfrom
mstange:push-rmyonxvqyyps
Apr 2, 2026
Merged

Always render the CPU-usage-aware activity graph when CPU information is available#5918
mstange merged 3 commits intofirefox-devtools:mainfrom
mstange:push-rmyonxvqyyps

Conversation

@mstange
Copy link
Copy Markdown
Contributor

@mstange mstange commented Mar 28, 2026

This simplifies the activity graph drawing code because we no longer have to check whether to respect CPU usage information.

This PR removes the 'category' timeline type and always uses 'cpu-category' to mean "CPU-aware category graph if CPU usage information is available, plain category graph otherwise". I'm still keeping the 'stack' timeline type but we can probably remove that one too.

When @canova first added the CPU-aware activity graph, I was a bit on the fence because I was afraid it would make responsiveness issues with lock contention less visible. So I think I may have been the primary audience for the ability to switch to the CPU-unaware activity graph. But I'm really happy with the CPU-usage aware activity graph these days and I've never made use of the ability to switch from the console.

… is available.

The UI for switching the activity graph type isn't visible
by default and nobody has complained about its absence.

This simplifies the code.

The timelineType values 'category' and 'cpu-category' are now equivalent.
@mstange mstange requested a review from canova March 28, 2026 16:47
@mstange mstange self-assigned this Mar 28, 2026
@mstange mstange force-pushed the push-rmyonxvqyyps branch 2 times, most recently from e219930 to 47f14ab Compare March 30, 2026 02:44
@mstange mstange force-pushed the push-rmyonxvqyyps branch from 47f14ab to 7aad328 Compare March 30, 2026 02:46
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.45%. Comparing base (23f14bf) to head (c886717).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/window-console.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5918   +/-   ##
=======================================
  Coverage   85.44%   85.45%           
=======================================
  Files         321      321           
  Lines       32164    32139   -25     
  Branches     8781     8850   +69     
=======================================
- Hits        27483    27463   -20     
+ Misses       4245     4241    -4     
+ Partials      436      435    -1     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@canova canova left a comment

Choose a reason for hiding this comment

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

Nice, one less thing to maintain!

I guess the stack height graph could still be useful for old profiles that don't contain any category information. But it's been a while since we added that, and using a default category would still be an okay solution for these older ones. But let's think about it some other time.

timelineType === 'cpu-category'
? (hoveredPixelState as HoveredPixelState).cpuRatioInTimeRange
: null
}
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.

Oh that was weird before. At first I thought we were removing the field which could result in a bug, but apparently it was always initialized to null and never changed...

%cwindow.experimental%c - The object that holds flags of all the experimental features.
%cwindow.togglePseudoLocalization%c - Enable pseudo localizations by passing "accented" or "bidi" to this function, or disable using no parameters.
%cwindow.toggleTimelineType%c - Toggle timeline graph type by passing "cpu-category", "category", or "stack".
%cwindow.toggleTimelineType%c - Toggle timeline graph type by passing "cpu-category" or "stack".
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.

I even forgot that toggleTimelineType existed! It's been that long since I've used it last time :)

@mstange mstange enabled auto-merge April 2, 2026 13:36
@mstange mstange merged commit 8114501 into firefox-devtools:main Apr 2, 2026
19 checks passed
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