firefox-devtools / firefox-devtools/profiler
If labels had hidden per-call identifier, could this be shown in the Stack Chart?
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
This is just the germ of an idea:
Currently all sample stack frames look the same. https://bugzilla.mozilla.org/show_bug.cgi?id=1465869 would help distinguish the difference types (js/label/native) from the source.
And then, each of these are just samples with one name, and there is currently no way to know if two adjacent samples with the same name are really part of an unbroken call, or actually two separate calls.
E.g., suppose we have A-B-C-X and then A-B-C-Y. This would be shown as one branch A-B-C, splitting to X and Y.
But maybe what really happened is that B called C-X, and then we came back to B, which called C (again) and then Y.
Now for the idea: I believe it would be easy and cheap for the backend to attach a unique identifier for each distinct instance of a label.
E.g., If 'C' was a label, two samples could have the same or a different id.
And I think this could then be shown in the Stack Chart (at least), by splitting the 'C' blocks with different ids.
I don't think the ids themselves should be shown, so they would have to be stored in a separate sample field in the profile JSON. (This is why https://bugzilla.mozilla.org/show_bug.cgi?id=1465869 would be a prerequisite, to already have a distinction between the types of frames, after which adding extra data for labels should be easier to handle.)
But maybe it could also be an option in Call Tree and Flame Graph, to split labels by ids.
Or at least show a count of distinct labels, to give an idea whether some branch was one very long call or many smaller calls.
Endless possibilities!
(If this idea is worth pursuing, it may be possible to do the same for js/jit frames, to be investigated...)
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-389)
Contributor guide
Assessment
This issue has not been assessed yet.