Skip to content

Fix the unnecessary stringify of Uint8Array contents during zip profile extraction#6004

Merged
canova merged 2 commits intofirefox-devtools:mainfrom
canova:fix-zip-arraybuffer
May 7, 2026
Merged

Fix the unnecessary stringify of Uint8Array contents during zip profile extraction#6004
canova merged 2 commits intofirefox-devtools:mainfrom
canova:fix-zip-arraybuffer

Conversation

@canova
Copy link
Copy Markdown
Member

@canova canova commented May 7, 2026

Fixes #6001.

See my analysis here for more context: #6001 (comment)

Example profile: before / after

canova added 2 commits May 7, 2026 13:15
`String(arbitraryFormat)` was meant to detect ArrayBuffers from
different realms, but when the input is already a Uint8Array, it
serializes all byte values as a comma-separated string, which allocates
hundreds of megabytes for large profiles.

Switch to `Object.prototype.toString.call` which returns the correct
`[object ArrayBuffer]` tag cross-realm without touching the array
contents.
This is not strictly necessary after we changed the `String()` inside
`unserializeProfileOfArbitraryFormat`. But this is more correct, so it's
better to keep change it.
@canova canova force-pushed the fix-zip-arraybuffer branch from 1e293f9 to 5783a76 Compare May 7, 2026 11:15
@canova canova requested review from fatadel and mstange May 7, 2026 11:18
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.82%. Comparing base (61e5d10) to head (5783a76).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6004   +/-   ##
=======================================
  Coverage   83.81%   83.82%           
=======================================
  Files         328      328           
  Lines       34255    34254    -1     
  Branches     9572     9572           
=======================================
  Hits        28712    28712           
+ Misses       5115     5114    -1     
  Partials      428      428           

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

@mstange mstange left a comment

Choose a reason for hiding this comment

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

Good find!

@canova canova merged commit f2d5354 into firefox-devtools:main May 7, 2026
23 checks passed
@canova canova mentioned this pull request May 7, 2026
canova added a commit that referenced this pull request May 7, 2026
Changes:

[Markus Stange] Use custom splitter component (#4606)
[fatadel] Fix Download button text color when clicked (#5985)
[Samuel Glauser] Fix fullscreen icon size in bottom box (#5987)
[Nazım Can Altınova] Add `profiler-cli` for querying profiles (#5963)
[Nazım Can Altınova] Bump profiler cli version to 0.1.0 (#5996)
[Markus Stange] Switch from max-height to maxHeight in JSX
style={{...}}. (#5990)
[carverdamien] Fix comment about how time and duration are stored
(#5997)
[Nazım Can Altınova] Do not show console error when libnames are failed
to parse as a URL (#5993)
[Nazım Can Altınova] Fix the unnecessary stringify of Uint8Array
contents during zip profile extraction (#6004)


And special thanks to our localizers:

en-CA: chutten
en-CA: Saurabh
en-GB: Ian Neal
es-CL: ravmn
fy-NL: Fjoerfoks
ia: Melo46
nl: Mark Heijl
ru: Valery Ledovskoy
sv-SE: Andreas Pettersson
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.

Profiler fails to load large profiles in a .zip file

2 participants