Both of them take tree-shaped data, and a quantity, and you want to attribute the space of the children to the parents. For disk space it’s:
100 /home/andy/foo.txt
42 /home/andy/src/bar.txt
For function profiles it’s
100 f() g()
42 f() g() h()
So you can use both visualizations with both kinds of data.
Also, ncdu is an curses UI for disk space, and I have to admit it’s pretty much as effective in practice as tree maps. It doesn’t necessarily give you a nice overview though
Huh, I had never noticed that treemaps and flame graphs have the “same shape”, as you put it! Nor had I noticed that Baobab’s sunburst graph was actually a (distorted) flame graph.
Yeah I remember using a Windows Treemap disk space program back in 2004 or so. There was one good one, and many bad ones. Treemaps appear to have been invented in the 1990’s
And then I don’t think Flame Graphs were invented until the 2010’s, by Brendan Gregg! It seems like the simpler and more accurate technique.
What I will say is that it is more abstract. People seem to get treemaps immediately, whereas most people initially view a flame graph as a time series, e.g. the x axis is time, when it’s really SPACE! It takes a second to make that adjustment.
I encountered treemaps first, then flame graphs. But then I realized flame graphs can visualize the same shape of data, and I prefer them:
https://www.brendangregg.com/blog/2017-02-06/flamegraphs-vs-treemaps-vs-sunburst.html
Both of them take tree-shaped data, and a quantity, and you want to attribute the space of the children to the parents. For disk space it’s:
For function profiles it’s
So you can use both visualizations with both kinds of data.
Also, ncdu is an curses UI for disk space, and I have to admit it’s pretty much as effective in practice as tree maps. It doesn’t necessarily give you a nice overview though
https://news.ycombinator.com/item?id=36872165
Huh, I had never noticed that treemaps and flame graphs have the “same shape”, as you put it! Nor had I noticed that Baobab’s sunburst graph was actually a (distorted) flame graph.
Thanks for the link!
Yeah I remember using a Windows Treemap disk space program back in 2004 or so. There was one good one, and many bad ones. Treemaps appear to have been invented in the 1990’s
https://en.wikipedia.org/wiki/Treemapping#History
And then I don’t think Flame Graphs were invented until the 2010’s, by Brendan Gregg! It seems like the simpler and more accurate technique.
What I will say is that it is more abstract. People seem to get treemaps immediately, whereas most people initially view a flame graph as a time series, e.g. the x axis is time, when it’s really SPACE! It takes a second to make that adjustment.
A great alternative to pprint is gron, which allows you to glean global structure easier
A nice resource for treemaps is from HCIP lab from University of Meryland, which I used a Java version 0 a while ago, https://www.cs.umd.edu/hcil/treemap/. There is also a post with some history around treemaps, here https://www.cs.umd.edu/hcil/treemap-history/.