jlfwong / jlfwong/speedscope

Incorrect stacking of events that are close in time

Open
#487 5 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

Hi,

I have the following trace that gets rendered incorrectly in speedscope
```
[
{ "name": "A", "ph": "X", "ts": 1732107141551429.079, "dur": 34670882.955, "pid": 1033891, "tid": 140390667650624, "args": {}},
{ "name": "B", "ph": "X", "ts": 1732107142997066.682, "dur": 476375.838, "pid": 1033891, "tid": 140390667650624, "args": {}},
{ "name": "C", "ph": "X", "ts": 1732107143473442.569, "dur": 300492.826, "pid": 1033891, "tid": 140390667650624, "args": {}}
]
```
The event B ends at `1732107143473442.520`, and event C starts at `1732107143473442.569` (49ns later), so C should be on the same stack, but just after B.

However, this is how it gets visualized in speedscope:
![image](https://github.com/user-attachments/assets/67869d83-e709-44f1-9399-cb1b604ffe64)

And in perfetto.dev:
![image](https://github.com/user-attachments/assets/6664acd9-f973-451b-a454-b8758f58a1b9)

My hunch is that this could be due to a double precision issue.

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.