Speed up _computeCallNodeTableHierarchy by keeping siblings ordered by func#5964
Merged
mstange merged 2 commits intofirefox-devtools:mainfrom Apr 24, 2026
Merged
Speed up _computeCallNodeTableHierarchy by keeping siblings ordered by func#5964mstange merged 2 commits intofirefox-devtools:mainfrom
mstange merged 2 commits intofirefox-devtools:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5964 +/- ##
==========================================
- Coverage 85.37% 85.32% -0.05%
==========================================
Files 322 323 +1
Lines 32069 32169 +100
Branches 8814 8849 +35
==========================================
+ Hits 27378 27448 +70
- Misses 4260 4290 +30
Partials 431 431 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
edfb03b to
23d5a09
Compare
canova
approved these changes
Apr 24, 2026
Member
canova
left a comment
There was a problem hiding this comment.
Wow, nice!
3 mins to less than 100ms is super cool 😄
…y func. Fixes firefox-devtools#5957. The ordering allows us to early-exit during the "is there an existing sibling with this func" check. And by keeping track of the last used sibling, some degenerate profiles with lots of siblings now have ~O(n) performance rather than O(n^2) in the number of siblings, because we're able to skip all the previously-inserted siblings since those have lower funcs.
23d5a09 to
fde75e3
Compare
Merged
fatadel
added a commit
that referenced
this pull request
Apr 28, 2026
Changes: [Nazım Can Altınova] Add Adel to the automatic dependency reviews (#5930) [fatadel] Fix arrow panel appearing behind marker tooltips (#5926) [fatadel] Upgrade Node.js from v22 to v24 (#5923) [Markus Stange] Use createStackTableBySkippingDiscarded in focusSelf. (#5916) [Markus Stange] Propagate isJS to symbolicated funcs (#5907) [Markus Stange] Always render the CPU-usage-aware activity graph when CPU information is available (#5918) [Nazım Can Altınova] Fallback to javascript highlighting in the source view as a backup (#5936) [Nazım Can Altınova] Properly type the return value of _languageExtForPath (#5937) [Nazım Can Altınova] Update typescript eslint dependencies (#5938) [Markus Stange] Modernize more of the transform functions (#5934) [Paul Adenot] Fix extractGeckoLogs for structured Log marker format (bug 2022540) (#5927) [Nazım Can Altınova] Move some profile fetching code into a separate module. (#5939) [Markus Stange] Update the hovered item when panning any viewport canvas (#5903) [Markus Stange] Migrate Home page animation to CSS transitions and remove react-transition-group (#5649) [Nazım Can Altınova] Fix test/lint commands on Windows and fix CI (#5947) [Nazım Can Altınova] Convert profile-logic/js-tracer.tsx to a ts file (#5942) [Markus Stange] Remove panelLayoutGeneration (#5946) [fatadel] Add CounterDisplayConfig to counters in the processed profile format (#5912) [Nazım Can Altınova] Fix eslint-config-prettier silently overriding custom rules (#5955) [fatadel] Dim non-matching nodes in the stack chart when searching (#5935) [Nazım Can Altınova] Fix loading .json.gz profiles from inside zip archives (#5959) [Ryan Hunt] Add a fullscreen button to the bottom box (#5605) [Markus Stange] Speed up _computeCallNodeTableHierarchy by keeping siblings ordered by func (#5964) [Markus Stange] Replace symbolicator-cli with a profiler-edit node tool (#5965) [Nazım Can Altınova] Add "Include idle samples" toggle to the call tree settings (#5968) [Nazım Can Altınova] Add dark mode versions of the fullscreen icons (#5972) [fatadel] Replace 4 counter track components with a single generic TrackCounter (#5944) [fatadel] Use ephemeral port for esbuild's internal dev server (#5974) [carverdamien] Remove category from LongTaskMarkerPayload (#5975) And special thanks to our localizers: de: Ger de: Michael Köhler el: Jim Spentzos en-GB: Ian Neal es-CL: ravmn fr: Théo Chevalier ia: Melo46 it: Francesco Lodolo [:flod] nl: Mark Heijl pt-BR: Marcelo Ghelman ru: Valery Ledovskoy ru: berry sv-SE: Andreas Pettersson tr: Grk zh-CN: Olvcpr423 zh-CN: wxie zh-TW: Pin-guang Chen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5957.
The ordering allows us to early-exit during the "is there an existing sibling with this func" check. And by keeping track of the last used sibling, some degenerate profiles with lots of siblings now have ~O(n) performance rather than O(n^2) in the number of siblings, because we're able to skip all the previously-inserted siblings since those have lower funcs.
On the sp3 15x profile, it reduces the time in that function from 710ms to 686ms on my machine: https://share.firefox.dev/4u6aFuz (minified names are wY and VK)
On the profile from issue 5957, it reduces the time from multiple minutes to 77ms: https://share.firefox.dev/48ktge1