jlfwong / jlfwong/speedscope

Show additional information in hover/elsewhere

Open
#539 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.8k
Forks
320
PR merge metrics
No merged PRs in 30d

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:

Image




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](https://github.com/jlfwong/speedscope/issues/518#issuecomment-3455079282) in #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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.