1. 20
    1. 12

      I encountered treemaps first, then flame graphs. But then I realized flame graphs can visualize the same shape of data, and I prefer them:


      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


      1. 2

        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!

        1. 1

          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.

    2. 3

      A great alternative to pprint is gron, which allows you to glean global structure easier

    3. 1

      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/.