Skip to content

Conversation

@mstange
Copy link
Contributor

@mstange mstange commented Jan 17, 2026

Production | Deploy preview

On large profiles, opening the source view can cause large allocations because we create Set objects for many stacks. In this PR I've experimented with a more compact storage of a collection of sets.

Before: https://share.firefox.dev/3NnthpO
After: https://share.firefox.dev/45dMNv1

getStackLineInfo now allocates 46MB instead of 220MB (4.8x reduction), and takes 146ms instead of 338ms (2.3x reduction), when opening the source view for mozjemalloc.cpp on https://share.firefox.dev/3NnzEcF.

To do:

mstange and others added 11 commits January 15, 2026 10:02
I want to add a call to a function from line-timings.ts but line-timings.ts
already depends on profile-data.ts, and I can't create a circular dependency
between profile-data.ts and line-timings.ts.
This means we can compute the right line number for the "hot spot" for the
call node that was passed to getBottomBoxInfoForCallNode, and not just for
the selected call node.

For example, getBottomBoxInfoForCallNode can be called with the right-clicked
call node which can be different from the selected call node, and we were
scrolling to the wrong spot in that case before this patch.

Fixes firefox-devtools#5758.
…/ address timings from the implementation for the global timings.
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 84.01937% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.60%. Comparing base (0dd124f) to head (3c99ec6).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/bottom-box.ts 65.30% 17 Missing ⚠️
src/utils/bitset.ts 0.00% 13 Missing ⚠️
...mponents/app/AssemblyViewNativeSymbolNavigator.tsx 42.10% 11 Missing ⚠️
src/utils/intset-table.ts 90.80% 8 Missing ⚠️
src/components/shared/AssemblyView-codemirror.tsx 50.00% 6 Missing ⚠️
src/components/shared/AssemblyView.tsx 66.66% 3 Missing ⚠️
src/actions/profile-view.ts 71.42% 2 Missing ⚠️
src/reducers/url-state.ts 83.33% 2 Missing ⚠️
src/components/shared/SourceView.tsx 0.00% 1 Missing ⚠️
src/profile-logic/address-timings.ts 98.21% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5761      +/-   ##
==========================================
- Coverage   85.67%   85.60%   -0.07%     
==========================================
  Files         315      318       +3     
  Lines       31110    31256     +146     
  Branches     8472     8612     +140     
==========================================
+ Hits        26654    26758     +104     
- Misses       4026     4068      +42     
  Partials      430      430              

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

Before: https://share.firefox.dev/3NnthpO
After: https://share.firefox.dev/45dMNv1

getStackLineInfo now allocates 46MB instead of 220MB (4.8x reduction),
and takes 146ms instead of 338ms (2.3x reduction), when opening the
source view for mozjemalloc.cpp on https://share.firefox.dev/3NnzEcF
@mstange mstange force-pushed the compact-stack-line-info branch from eccf8c3 to 3c99ec6 Compare January 17, 2026 19:35
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.

1 participant