Skip to content

Rename threadCPURatio to threadCPUPercent and make it a Uint8Array#5898

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

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

Conversation

@mstange
Copy link
Copy Markdown
Contributor

@mstange mstange commented Mar 19, 2026

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
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

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.

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.

LGTM, thanks!

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