-
Notifications
You must be signed in to change notification settings - Fork 306
Description
It would be very useful if speedscope could show additional information / metadata for each block. For instance, I've collected both call counts and duration for functions. I've written the data out in the stackcollapse format with the duration as weight, but to my knowledge there's no way to push call counts into the UI. Currently I have to go back and forth between the UI and the source data, which is time consuming.
I'm thinking this metadata could be either key-value or some tree structure to be as agnostic about the contents as possible. For instance, this would be very helpful:
The metadata wouldn't be used in the algorithm to join blocks, it's purely added back in at the end. I know difficulties may arise when two blocks in the input are joined. The key-value pairs and/or trees could be joined but you lose origin information. Perhaps add some origin block identifier as a header in those cases?
Other use cases I can think of:
- Using speedscope to show file sizes of a file system (to find the largest disk space consumers), and showing metadata like create time, last modified time in the hover popup.
- tg-solidat's use case in Support annotations, like those in Chrome #518
As tg-solidat points out just having the information in the hover pop up doesn't allow for copying, so it would be nice if the data was shown somewhere with the summary statistics pane as well.
In terms of file format, the easiest I can think of would be to define an extension to the stackcollapse format where whatever additional information comes after the weight. But a custom file format based on JSON would be great as well, as it's widely supported and would allow for text that needs escaping characters, newlines, etc
If such an "additional information" showing feature exists, other existing format parsers for speedscope could put the information they currently throw away from the source format in there as well.