Skip to content

Rename threadCPURatio to threadCPUPercent and make it a Uint8Array - #5898

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-supsprxtoqru
Mar 24, 2026
Merged

Rename threadCPURatio to threadCPUPercent and make it a Uint8Array#5898
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-supsprxtoqru

Conversation

@mstange

@mstange mstange commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

This turns it into a Uint8Array of integer percentages, which requires less memory bandwidth when rendering the activity graph.

We now always have a fallback threadCPUPercent array, even if the original profile doesn't contain any threadCPUDelta information. The synthesized values are set to 100%.

We also have a trailing extra value in order to simplify the rendering code for the last sample.

There's one behavior change related to the one-past-the-end value: In the past, we said "after the last sample, continue with the same CPU percentage as just before the last sample". Now we say "after the last sample, the CPU percentage is zero." The profile from the 'matches the 2d canvas draw snapshot with only one CPU usage value' test demonstrates this:
Main branch | Deploy preview

@mstange
mstange requested a review from canova March 19, 2026 01:24
@mstange
mstange force-pushed the push-supsprxtoqru branch 3 times, most recently from 163c939 to cde9ded Compare March 19, 2026 01:31
@codecov

codecov Bot commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.41%. Comparing base (cb9c976) to head (f3f07c7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5898      +/-   ##
==========================================
- Coverage   85.42%   85.41%   -0.01%     
==========================================
  Files         321      321              
  Lines       32168    32157      -11     
  Branches     8785     8865      +80     
==========================================
- Hits        27479    27468      -11     
  Misses       4253     4253              
  Partials      436      436              

☔ 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.

@canova canova 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, thanks!

Comment thread src/components/shared/thread/CPUGraph.tsx Outdated
 
This turns it into a Uint8Array of integer percentages,
which requires less memory bandwidth when rendering the
activity graph.

We now always have a fallback threadCPUPercent array, even
if the original profile doesn't contain any threadCPUDelta
information. The synthesized values are set to 100%.

We also have a trailing extra value in order to simplify the
rendering code for the last sample.
@mstange
mstange force-pushed the push-supsprxtoqru branch from cde9ded to f3f07c7 Compare March 24, 2026 17:36
@mstange
mstange enabled auto-merge March 24, 2026 17:37
@mstange
mstange merged commit e743aec into firefox-devtools:main Mar 24, 2026
19 checks passed
@canova canova mentioned this pull request Apr 2, 2026
canova added a commit that referenced this pull request Apr 2, 2026
Changes:

[Ojus Chugh] Pass profile upgrade info to stateFromLocation in compare
view (#5890)
[Markus Stange] Rename threadCPURatio to threadCPUPercent and make it a
Uint8Array (#5898)
[Ojus Chugh] Fix dev server rejecting non-localhost hosts when using
FX_PROFILER_HOST (#5889)
[Markus Stange] Bump iongraph-web dependency (#5921)
[Markus Stange] 🔃 Sync: l10n -> main (March 31, 2026) (#5925)
[fatadel] Fix broken link in the dev tools message (#5924)
[Nazım Can Altınova] Update typescript 5.9.3 → 6.0.2 (major) (#5920)
[Nazım Can Altınova] Bump iongraph-web to 0.2.1 (#5928)

And special thanks to our localizers:

en-CA: chutten
zh-CN: wxie
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