Skip to content

Adjust string index fields in markers when merging threads#5344

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:merged-thread-marker-unique-string-adjustment
Jan 27, 2025
Merged

Adjust string index fields in markers when merging threads#5344
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:merged-thread-marker-unique-string-adjustment

Conversation

@mstange

@mstange mstange commented Jan 27, 2025

Copy link
Copy Markdown
Contributor

@mstange mstange requested a review from julienw January 27, 2025 01:01
@mstange mstange self-assigned this Jan 27, 2025

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix, this looks good to me!

Comment thread src/profile-logic/marker-schema.js
Comment on lines +1305 to +1316
for (const fieldKey of stringIndexMarkerFields) {
const stringIndex = data[fieldKey];
if (typeof stringIndex === 'number') {
const newStringIndex = newStringTable.indexForString(
stringArray[stringIndex]
);
data = ({
...data,
[fieldKey]: newStringIndex,
}: any);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(optional because probably not a perf problem): I'd do a clone of data before the loop, and do direct assignments on data inside the loop, instead of recreating data for each item.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I never replied to this... I think I saw both advantages and disadvantages with that approach, and then determined that it wasn't worth spending time debating it because this code will be removed once we have a shared string table.

Comment thread src/profile-logic/marker-schema.js
@mstange mstange force-pushed the merged-thread-marker-unique-string-adjustment branch from fc45583 to 7893e16 Compare January 27, 2025 16:44
@mstange mstange enabled auto-merge January 27, 2025 16:44
@mstange mstange merged commit 8118f96 into firefox-devtools:main Jan 27, 2025
@canova canova mentioned this pull request Jan 30, 2025
canova added a commit that referenced this pull request Jan 30, 2025
Updates:

[Julien Wajsberg] Some more small refactorings (#5320)
[Markus Stange] Pass the correct sample index offset to
getTimingsForCallNodeIndex for the flame graph tooltip. (#5328)
[Nisarg Jhaveri] Update docs to include Android Studio/Simpleperf trace
file support (#5309)
[Markus Stange] Don't pass the preview filtered thread to
getTimingsForPath/CallNodeIndex. (#5329)
[Nazım Can Altınova] Add a "Sample timestamp" field to the sample
tooltip in timeline (#5322)
[Markus Stange] Reduce confusion between call tree summary strategy
aware samples and regular samples (#5330)
[Markus Stange] Rename this getCounter selector to getCounters. (#5337)
[Markus Stange] Make sample indexes compatible between the unfiltered
and (preview) filtered call tree summary strategy samples when using an
allocation strat>
[Markus Stange] Remove some code that uses the preview filtered thread
(#5336)
[Markus Stange] Remove getMarkerSchemaName special cases - look up
marker schemas from data.type and nothing else (#5293)
[Markus Stange] Remove the makeProfileSerializable step - make the raw
in-memory profile match the format that's stored in the file (#5287)
[Nicolas Chevobbe] Adapt FilterNavigatorBar to High Contrast Mode.
(#5257)
[Nicolas Chevobbe] Adapt Tracks to High Contrast Mode. (#5252)
[Markus Stange] Adjust string index fields in markers when merging
threads (#5344)
[Theodoros Nikolaou] Localize title and aria label in ProfileName
(#5345)
[Julien Wajsberg] Adapt time-slice selection in High Contrast Mode.
(#5259)
[Markus Stange] Make stackTable (sub)category derived data (#5342)
[Markus Stange] Compute cpuRatio values when computing the derived
thread (#5288)
[Nazım Can Altınova] Add a context menu item to open the JS scripts in
DevTools debugger (#5295)

Also thanks to our localizers:

el: Jim Spentzos
fr: Théo Chevalier
it: Francesco Lodolo [:flod]
zh-TW: Pin-guang Chen
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.

Thread merging doesn't update string indexes in marker fields

2 participants