firefox-devtools / firefox-devtools/profiler

Add an option to sort the flame graph by source location of caller instead of alphabetical

Open
#4,141 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 46m
Merged PRs (30d)
27

Description

It's always sort of bothered me that flames graphs sort alphabetically as this is sort of arbitrary.

Imagine we have the following example:

```rust

fn a() {
x();
c();
x();
}

```

today the flame graph for the above looks like:

```
c x
a a a
```

I'd like to look like:

```
x c x
a a a a
```

We can get the new flame graph by using the line number, column number of the caller location as the sort key instead of name of callee.

The advantage of this approach is that it better matches the order things are called and so it corresponds a bit better to the x-axis being time. Also, splitting out the two calls to `x` seems like it could also be useful to see, though if we wanted to we could also remerge them together.

┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-562)

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.