firefox-devtools / firefox-devtools/profiler
Consider combining the "isJS" and "relevantForJS" columns of the funcTable into a "stackType" column
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
The funcTable currently has two boolean columns called `isJS` and `relevantForJS`. Two bools give four possible combinations, but we're only making use of three possible combination: the "both true" combination is not used. More specifically, if a func has `isJS == true`, then its `relevantForJS` value is ignored.
I think it would be a good idea to combine the two fields into one, with the possible values: `js`, `js-relevant-label`, and `other`.
We also have code that detects funcs for "profiler labels", in order to dim their text in the call tree. It does this by looking at the `resource` column: https://github.com/firefox-devtools/profiler/blob/1684c4799bb8fde27a6fa34c7ea27d892c9a1bc5/src/profile-logic/call-tree.js#L225
So I think we should go even further and split the `other` value into `label` and `native`.
Then we can call the new field `stackType`:
```
stackType: 'js' | 'js-relevant-label' | 'native-relevant-label' | 'native'
```
(Here I've renamed the `label` value to `native-relevant-label`, because otherwise it would sound like a superset of the `js-relevant-label` value, but we want all possible values to be distinct.)
And, to save space in the JSON, rather than using strings we could use numbered constants. We already do this for resourceType column of the resource table: https://github.com/firefox-devtools/profiler/blob/6c30afd98f7753caaab370efe3e5c568fe872779/src/profile-logic/data-structures.js#L254-L263
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-263)
Contributor guide
Assessment
This issue has not been assessed yet.