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:

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

@mstange mstange force-pushed the compact-stack-line-info branch 3 times, most recently from d4058a5 to d446334 Compare January 22, 2026 04:05
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 d446334 to 5858c75 Compare January 22, 2026 04:08
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