WIP upload as JSLB - #6193
Draft
mstange wants to merge 9 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6193 +/- ##
==========================================
- Coverage 83.79% 83.78% -0.01%
==========================================
Files 350 350
Lines 37583 37664 +81
Branches 10459 10573 +114
==========================================
+ Hits 31492 31557 +65
- Misses 5664 5680 +16
Partials 427 427 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mstange
force-pushed
the
push-rusqtwztrtmr
branch
from
July 16, 2026 14:46
1f8e1b6 to
17c1382
Compare
The Download and Share panels have independent sharing options, so they
sanitize to different profiles. sanitizePII always allocates a new Profile
(even its no-op early return does {...profile, shared}), so the two modes
never produce an identical object.
The encoding state was a single slot keyed on that identity, which meant:
- Each panel open missed both reuse checks and clobbered the other mode's
entry, so an untouched profile was re-serialized and re-gzipped on every
single open, forever. Alternating opens never settled.
- The panel rendered whatever blob was in the shared slot, with no check
that it had been encoded for its own mode's options. Opting into URLs in
Share and then opening Download left a DONE blob containing those URLs
sitting in the slot. What kept that from being offered was only that
componentDidMount dispatches ENCODING synchronously before paint -- an
accidental invariant, not a designed one.
Give each mode its own slot and thread the mode through the three encoding
actions. mapStateToProps now selects by ownProps.mode, so a panel is
structurally incapable of seeing the other mode's blob, and each mode's
encoding survives reopening.
… JSON. Serialize the sanitized profile with serializeProfileToJsonSlabsFile (preceded by optimizeProfileForStorage to convert eligible columns to typed arrays). Downloads from the panel now offer a .jslb.gz file. Fetches from the profile store already handle JSLB via unserializeProfileOfArbitraryFormat, and the storage endpoint treats the payload as opaque bytes, so no server-side change is needed.
…ion. The main download button downloads the profile as JSLB (as before). A new dropdown arrow next to it opens a menu with 'Download as JSON'. The JSON encoding is kicked off lazily when the dropdown is first opened, and re-encoded when the user toggles sharing options after that. The upload path continues to use JSLB exclusively. The encoding state in Redux is now keyed by format (jslb, json), and the selector/action APIs take a PublishProfileFormat argument.
…ats. Switch the split download button's dropdown from ButtonWithPanel/ArrowPanel to a react-contextmenu menu (the same style used next to the marker chart's search field). The toggle is a plain photon button with a CSS-drawn caret; showMenu opens the menu at the button's bottom-right.
showMenu positions the menu's top-left at the given coords. Subtracting a fixed menu width from the toggle button's right edge right-anchors the menu so its top-right lines up with the button's bottom-right, and it grows leftwards into the panel instead of off toward the right edge.
encodeSanitizedProfile's promise body runs its serializer synchronously up to the first await, so kicking it off from the menu's onShow blocked the menu's first paint on large profiles. setTimeout(0) yields to the browser so the menu appears immediately.
mstange
force-pushed
the
push-rusqtwztrtmr
branch
from
August 19, 2026 21:37
17c1382 to
0d4b417
Compare
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.
Main | Deploy preview
This is currently blocked until we deploy firefox-devtools/profiler-server#696 on the server side.
I'm also considering waiting a bit more before landing this because the perf difference from encoding to jslb will be more pronounced once we've converted more columns to typed arrays.