EmbarkStudios / EmbarkStudios/puffin

Hierarchical mode for stats view

Open
#127 0 comments 0 reactions 0 assignees View on GitHub
enhancement GUI
Dominant language
Rust
Stars
1.7k
Forks
111
Avg merge
2h 50m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**

When optimizing, one of my favourite approaches is the parent% metric. This isn't too hard to compute, but right now the viewer doesn't present the data in an accessible way. What I want is a tree where the root nodes are the top level scopes, and each layer only has the statistics for the node when called from that parent.

**Describe the solution you'd like**

A view something like this:

```
scope self parent% total%
└── app-update 13ms 100% 100%
├── input 1ms 7% 7%
│ ├── keyboard 300us 30% 2.1%
│ └── mouse 100us 10% 0.7%
├── ai 4ms 30% 30%
│ ├── raycasts 1ms 25% 7.5%
│ └── navigation 2.5ms 62.5% 20%
└── player 2ms 15% 15%
└── weapon 0.5ms 25% 3.25%
├── raycasts 0.2ms 40% 1.3%
└── hitmarker 0.2ms 40% 1.3%
```

I don't think the view necessarily has to present % - I think being able to correlate parent/child relationship of scopes is the important part.

**Describe alternatives you've considered**

This can be somewhat manually created by carefully finding the immediate children in the flamegraph, and then filtering the stats view. If there was a way to highlight or filter descendants that'd make it somewhat easier with the current tool. However, since some scopes might have multiple parents (e.g. raycasts above) it doesn't *quite* get there.

**Additional context**

This is an example of how it's presented in Firefox Performance view:
![image](https://user-images.githubusercontent.com/8234817/216554088-dd8c4b9d-a313-4de2-8167-d319565cd4b4.png)

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.