firefox-devtools / profiler

Firefox Profiler — Web app for Firefox performance analysis
https://profiler.firefox.com
Mozilla Public License 2.0
1.18k stars 384 forks source link

Thread merging doesn't update string indexes in marker fields #5098

Open mstange opened 2 weeks ago

mstange commented 2 weeks ago

Steps to reproduce:

  1. Load https://share.firefox.dev/3T3UduQ
  2. Move your mouse over the markers and see that the tooltip displays normal strings.
  3. Shift-click the TaskController thread, so that you have a multi-thread selection.
  4. Move your mouse over the markers again.

Expected results: The same strings as before should be shown in the tooltip.

Actual results: The tooltip displays nonsense strings with hex addresses.

julienw commented 2 weeks ago

Ah interesting, this should happen somewhere in the function https://github.com/firefox-devtools/profiler/blob/6a8c668e51c24f697bd21a94f0b2e02767019e02/src/profile-logic/merge-compare.js#L1182. We're already doing something similar hardcoded for CompositorScreenshot markers, but here we need to look at the original markerSchema. The general solution should also handle merging the markerSchemas, but we can start with the easy case of merging 2 threads of the same profile (so with the same markerSchema for both).