More additions to profiler-edit, for sp3 profiles#6009
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6009 +/- ##
==========================================
- Coverage 83.69% 83.34% -0.35%
==========================================
Files 338 338
Lines 35693 35868 +175
Branches 9904 9944 +40
==========================================
+ Hits 29873 29895 +22
- Misses 5392 5545 +153
Partials 428 428 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fd67c9e to
f5ac119
Compare
f5ac119 to
33ec551
Compare
508ee02 to
9d9f405
Compare
9d9f405 to
e496d7c
Compare
There was a problem hiding this comment.
Thanks! Looks good to me! I noticed one thing though:
It looks like we are mutating profile.threads with both --only-keep-threads-with-markers-matching and --merge-non-overlapping-threads, but we also have some references to those threads array elements in counter's mainThreadIndex and profilerOverhead's mainThreadIndex. They are not being updated right now, which will reference a different thread after these operations.
I guess it's not super crucial for the sp3 profiles as they most likely don't contain counters (and we don't care about profilerOverhead) but it's good to be correct, so it's up to you if you want to land it now and follow-up later.
| const frontEndSchemaNames = new Set( | ||
| markerSchemaFrontEndOnly.map((schema) => schema.name) | ||
| ); | ||
| const schemaList = [ | ||
| ...(profile.meta.markerSchema ?? []).filter( | ||
| (schema) => !frontEndSchemaNames.has(schema.name) | ||
| ), | ||
| ...markerSchemaFrontEndOnly, | ||
| ]; |
There was a problem hiding this comment.
Nit: This is the same logic as the one in the getMarkerSchema selector. It would be good to extract that into a function and reuse here.
There was a problem hiding this comment.
Added a computeCombinedMarkerSchemaList function.
| const markerSchemaByName: MarkerSchemaByName = Object.create(null); | ||
| for (const schema of schemaList) { | ||
| markerSchemaByName[schema.name] = schema; | ||
| } |
There was a problem hiding this comment.
Nit: Similarly this is the same logic as getMarkerSchemaByName.
There was a problem hiding this comment.
Added a computeMarkerSchemaByName function.
| console.log( | ||
| `Matched ${mergedProcessBundles} non-overlapping process bundles. Merged ${mergedIndexes.size + mergeReplacements.size} threads into ${mergeReplacements.size}, going from ${threads.length} to ${newThreads.length} threads.` | ||
| ); |
There was a problem hiding this comment.
I think it would be better to leave the console.log out of src/profile-logic/. Can we move that to the profiler-edit side?
There was a problem hiding this comment.
I'll just remove it for now.
| // If every source thread has threadCPUDelta, carry the per-sample values | ||
| // through unchanged. For non-overlapping inputs the resulting deltas remain | ||
| // meaningful; for overlapping inputs the values are nonsensical but harmless | ||
| // (still numerically valid). |
There was a problem hiding this comment.
Hmm, I'm not super sure about this. I guess it makes sense for non-overlapping threads. But for overlapping ones, I'm afraid that the data will be too weird. Have you tried it with overlapping threads? How do they look?
There was a problem hiding this comment.
True. I haven't tried it but I agree that it's likely going to be garbage. Added a check for non-overlappingness and preserved the old behavior if overlapping.
There was a problem hiding this comment.
Nice, yeah that sounds better to me! Thanks!
e496d7c to
d249c12
Compare
Ah, good catch. I've added a commit at the end which updates those values. |
Changes: [Nazım Can Altınova] Fix call node context menu being hidden behind source view bottom box (#6045) [Nazım Can Altınova] Pass `--use-env-proxy` only when the node version is >= 24 (#6064) [fatadel] Upgrade @firefox-devtools/react-contextmenu to 5.2.4 (#6066) [Markus Stange] Switch profiler-edit from minimist to commander (#6065) [Markus Stange] Support reading profiles from JsonSlabs files (#6037) [Florian Quèze] Don't fail profile processing when a marker's stack field is not a backtrace (#6069) [fatadel] Replace the footer-links overlay with a settings menu (#6042) [fatadel] Upgrade @types/node to match Node 24 (#6070) [fatadel] Remove unused undici-types package (#6074) [cathaysia] Update isLocalURL to include LAN addresses, .local domains, and hostn… (#5973) [Markus Stange] Fix from-url with binary profiles (#6072) [fatadel] Upgrade to React 19 (#6067) [Markus Stange] Add an insertStackLabels helper. (#6076) [fatadel] Drive counter tooltips from a tooltipRows schema (#6023) [fatadel] Add TrackPower--tooltip-average-power-microwatt (#6080) [Markus Stange] Downgrade to React 19.1 to fix unusable dev build performance. (#6082) [Nazım Can Altınova] Add source map symbolication and source view support (#6018) [spokodev] fix(FilterNavigatorBar): clip overflow so many breadcrumbs do not expand the parent (#6085) [Markus Stange] Move paddings inside the tree header cells. (#6002) [Markus Stange] Add an --insert-label-frames argument to the profiler-edit tool (#5966) [Markus Stange] Stop printing "error: too many arguments" during tests. (#6088) [Markus Stange] More additions to profiler-edit, for sp3 profiles (#6009) [Nazım Can Altınova] Do not rely on localized texts in the settings menu tests (#6101) And special thanks to our localizers: be: Andrei Mukamolau de: Ger de: Michael Köhler de: Ralf Duehnfahr el: Jim Spentzos en-CA: chutten en-GB: Ian Neal es-CL: ravmn fr: Théo Chevalier fr: wy fur: Fabio Tomat fy-NL: Fjoerfoks ia: Melo46 it: Francesco Lodolo [:flod] nl: Mark Heijl ru: Valery Ledovskoy sr: Марко Костић (Marko Kostić) sv-SE: Andreas Pettersson tr: Grk tr: Selim Şumlu zh-CN: Olvcpr423 zh-TW: Pin-guang Chen
This makes it so that you can run profiler-edit with
--insert-label-frames browser_labels.toml --only-keep-threads-with-markers-matching='-async,-sync' --merge-non-overlapping-threads-by-name --set-name 'Sp3 5x (with labels, combined main threads)'to turn https://share.firefox.dev/4cXQFED into https://share.firefox.dev/4ezEcsaThe label frames are useful in the JS-only view when applied to profiles from samply; they let us group work like "Paint" and "JS Parsing" (example toml). You can best see them in action in the function list deploy preview: JS-only, ordered by self, with the Self wing showing where the time is spent.