Skip to content

Some more activity graph drawing perf improvements#5886

Merged
mstange merged 4 commits into
firefox-devtools:mainfrom
mstange:push-wtztxxruollm
Mar 19, 2026
Merged

Some more activity graph drawing perf improvements#5886
mstange merged 4 commits into
firefox-devtools:mainfrom
mstange:push-wtztxxruollm

Conversation

@mstange

@mstange mstange commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

See individual commits.

@codecov

codecov Bot commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.44%. Comparing base (8ac20f5) to head (8cad8d9).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5886   +/-   ##
=======================================
  Coverage   85.44%   85.44%           
=======================================
  Files         321      321           
  Lines       32061    32050   -11     
  Branches     8753     8836   +83     
=======================================
- Hits        27393    27385    -8     
+ Misses       4236     4233    -3     
  Partials      432      432           

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

@mstange mstange force-pushed the push-wtztxxruollm branch from 961c48b to 21b7660 Compare March 9, 2026 14:10
@mstange mstange requested a review from canova March 9, 2026 14:12
@mstange mstange force-pushed the push-wtztxxruollm branch from 21b7660 to f90c13d Compare March 9, 2026 15:02

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

Looks good to me with some nits. Thanks!

) => void;
readonly categories: CategoryList;
readonly sampleSelectedStates: null | Uint8Array;
readonly sampleSelectedStates: Uint8Array;

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.

Nice!

Nit: Grepping for sampleSelectedStates: still shows some types that are left as null | Uint8Array;. Can you also convert them to Uint8Array?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, fixed.

readonly filteredOutByTabPercentageAtPixel: Float32Array<ArrayBuffer>;
};
// These Float32Arrays are mutated in place during the computation step.
// buffers[selectedState] is the buffer for the given SelectedState.

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.

"for the given SelectedState."

This part was a bit difficult to understand for me. Then I remembered SelectedState was an enum that we have now. I feel like this could make it easier to understand for me "for the given SelectedState enum value."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good suggestions, fixed.

readonly timeRange: Milliseconds;
};

const SELECTED_STATE_BUFFER_COUNT = 4;

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.

This is a bit magical, and separate from the SelectedState enum. I think we could add a comment to both here and SelectedState to make sure to update if we add a new value. Or we can move it near the enum.

I tried to see if there is a better way to get the const enum max value, but it seems like there isn't one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree it's not pretty. I'm going to leave it as-is now because the upcoming commits will change this around some more.

samplesSelectedStates !== null &&
samplesSelectedStates[i] === SelectedState.Selected
sampleSelectedStates !== null &&
sampleSelectedStates[i] === (SelectedState.Selected as number)

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.

Nit: Do we need these as number casts here and in other places in this commit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without it, there are lint failures from https://typescript-eslint.io/rules/no-unsafe-enum-comparison/

@mstange mstange force-pushed the push-wtztxxruollm branch from f90c13d to 8cad8d9 Compare March 19, 2026 00:53
@mstange mstange enabled auto-merge March 19, 2026 00:53
@mstange mstange merged commit 7bbf5c6 into firefox-devtools:main Mar 19, 2026
19 checks passed
@canova canova mentioned this pull request Mar 20, 2026
canova added a commit that referenced this pull request Mar 20, 2026
Changes:

[Markus Stange] Start using const enum (#5879)
[Markus Stange] Some performance improvements (#5878)
[Nazım Can Altınova] Add startLine, startColumn, sourceMapURL and rename
uuid to id in source table (#5882)
[Markus Stange] Reduce repetition in profile compacting code (#5885)
[Markus Stange] Some more activity graph drawing perf improvements
(#5886)
[fatadel] Make network markers in the network panel sticky on click
(#5884)
[Markus Stange] Improve SampleGraph and HeightGraph performance (#5897)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (March 20, 2026) (#5899)

And special thanks to our localizers:

be: Andrei Mukamolau
el: Jim Spentzos
en-GB: Paul
es-CL: ravmn
ia: Melo46
sv-SE: Andreas Pettersson
tr: Nazım Can Altınova
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