jlfwong / jlfwong/speedscope

[Feature Request] View Multiple Process Flamegraphs at Once

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

Description

Currently the approach to viewing multiple processes/threads is to switch between processes as implemented in [#82](https://github.com/jlfwong/speedscope/issues/82), but it would be very nice if instead we could compare them all on the same screen, to compare what is happening across threads.

This could look like:
![mockup](https://github.com/jlfwong/speedscope/assets/124093999/03a420af-564d-4315-93ce-e7269ba71383)
and was wondering if there was an easy way to do this. I tried experimenting with the JSON to hack this out with something like:
```
{
"exporter": "speedscope@1.20.0",
"name": "test.txt",
"activeProfileIndex": 0,
"$schema": "https://www.speedscope.app/file-format-schema.json",
"shared": {
"frames": [
{
"name": "event1"
},
{
"name": "event2"
}
]
},
"profiles": [
{
"type": "evented",
"name": "perf-vertx-stacks-01-collapsed-all.txt",
"unit": "none",
"startValue": 0,
"endValue": 500,
"events": [
{
"type": "O",
"frame": 0,
"at": 0
},
{
"type": "O",
"frame": 1,
"at": 6
},
{
"type": "C",
"frame": 0,
"at": 9
},
{
"type": "C",
"frame": 1,
"at": 12
}
]
}
]
}
```
but it gave
```
Failed to load format Error: Tried to leave frame "event1" while frame "event2" was at the top at 9
at h._leaveFrame (speedscope.80eb88d2.js:165:8075)
at h.leaveFrame (speedscope.80eb88d2.js:165:8535)
at speedscope.80eb88d2.js:171:1753
at a (speedscope.80eb88d2.js:171:1800)
at speedscope.80eb88d2.js:171:2361
at Array.map ()
at s (speedscope.80eb88d2.js:171:2354)
at import.7f8cb9f9.js:121:2101
at Generator.next ()
at s (import.7f8cb9f9.js:121:780)
```
so I think this might require some code changes that I'm not familiar with.

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.