jlfwong / speedscope

🔬 A fast, interactive web-based viewer for performance profiles.
https://www.speedscope.app
MIT License
5.59k stars 246 forks source link

Aggregation methods for size-values in Sandwich view? #421

Open yepitschunked opened 1 year ago

yepitschunked commented 1 year ago

We're playing around with using Speedscope to visualize a Javascript bundle/module dependency graph, using the speedscope.json format. So far the Sandwich view has been the most helpful, but we're running into a problem with shared modules. With timing data, it makes sense to aggregate multiple call stacks by summing their weights, but with size data it just multiplies the size of each dependency by the number of parents.

This isn't an issue with the Left-heavy view, since it doesn't try to aggregate different caller stacks. But that view is not as nice to navigate.

We've tried a couple of ways of formatting our data, none of which have been perfect:

I think in a sense we're trying to assign weights to the Frame rather than to each sample, if that makes sense. Or maybe aggregate samples by taking the average rather than the sum. I'm not sure if there's some other way to structure our samples that would solve this.