Remix.run Logo
Flame Graphs vs Tree Maps vs Sunburst (2017)(brendangregg.com)
115 points by gudzpoz 3 days ago | 30 comments
alanbernstein 8 hours ago | parent | next [-]

Personally, I find treemaps unmatched for disk space analysis. Specifically, I like to use the squarify layout algorithm, to NOT use the "cushion gradient" shading method, to use inset frames to convey depth visually, and to include filenames. This maximizes glanceable information density, for the use case of identifying large objects to delete to recover space.

This is how the old spacemonger app worked, and I liked it so much I had to recreate it for Linux/Mac: https://github.com/alanbernstein/treemonger. My version still needs some work, but it's minimally useable.

formerly_proven 7 hours ago | parent [-]

Treemaps are also good for profiling (see KCachegrind), they waste a lot less space than flamegraphs and the area-relationship is relatively well maintained.

trevor-e 8 hours ago | parent | prev | next [-]

The treemap screenshot doesn't look correct. Nearly all charting libs (like Apache Echarts) will group nodes with a heading name, so not sure why they claim it would be hard to notice the "drivers" node. I guess in that screenshot, sure, but that looks like just a bad implementation of a treemap. Maybe this was the case back in 2017?

Flame graphs I have a love/hate relationship with. The hierarchy is very useful, but the name and coloring can be very confusing and misleading. Most people I show them to think red == something bad, but the color is actually just for aesthetics.

tanelpoder 6 hours ago | parent [-]

At an old startup attempt we once created a nested hierarchy metrics visualization chart that I later ended up calling Bookshelf Charts, as some of the boxes filled with with smaller boxes looked like a bookshelf (if you tilted your head 90 degrees). Something between FlameGraphs and Treemaps. We also picked “random” colors for aesthetics, but it was interactive enough so you could choose a heat map color for the plotted boxes (where red == bad).

The source code got lost ages ago, but here are some screenshots of bookshelf graphs applied to SQL plan node level execution metrics:

https://tanelpoder.com/posts/sql-plan-flamegraph-loop-row-co...

trevor-e an hour ago | parent | next [-]

Thanks for sharing, that is a neat in-between.

theodpHN 3 hours ago | parent | prev [-]

Very neat. And if anyone from Plotly should happen to be reading this, a compact format like this might be an interesting option for Icicle Charts, akin to how the compact, indented version of Excel pivot tables saves horizontal space over the "classic" format pivot table.

CuriouslyC 8 hours ago | parent | prev | next [-]

Treemap is the densest/most accurate information source on a per px basis. Flamegraphs are pretty good but with a fixed Y and variable X your box area is inaccurate, and it wastes a fair amount of plot space with the non-flame area. The sunburst chart is really pretty but bad from an information communication perspective.

rphln 10 hours ago | parent | prev | next [-]

Flamegraphs are a really lovely tool for visualizing trees. Slightly related anecdote:

A while ago I was experimenting with interactive exploration of (huge) Monte Carlo Tree Search trees. Inspired by file system visualization tools, my first attempts were also tree maps and sunburst graphs, but I ran into the same problems as in the article.

I tried flamegraphs next with the following setup:

- The number of visits in each node maps to the width and order of each bar (i.e., the most visited node was first and was the largest)

- The expected value maps to the color of each bar.

And then it was a perfect fit: it's easy to see what's going on in each branch at the first levels, and the deeper levels can be explored through drilling down.

dizlexik 5 hours ago | parent | prev | next [-]

I've been using WinDirStat for a tree visualization of Windows disk space for a very long time. Great software. https://windirstat.net/

Culonavirus 3 hours ago | parent | next [-]

SpaceSniffer is also good (and a single exe), I keep it on all my windows machines desktops for yeeeeears

smlavine 4 hours ago | parent | prev [-]

QDirStat is a Linux equivalent: https://github.com/shundhammer/qdirstat

Espressosaurus 10 hours ago | parent | prev | next [-]

All of these suck. Use nested bar graphs like TreeSize and it’s instantly obvious what your biggest hitter is for any particular nesting level.

In lieu of that, a flame graph is tolerable. The polar coordinate one is very pretty garbage. EDIT: Use it when you want to mislead people with a flashy graph.

noosphr 7 hours ago | parent | next [-]

All embeddings of hyperbolic space into eucleadean space suck. You can't preserve distances and areas between them. Trees live in a hyperbolic space so every visualization of trees on a screen will suck in some way.

This simple math fact is the reason why all grand hyperlink projects from 1960 to 2010 couldn't work, e.g. Xanadu.

Worse, in small examples with fewer than a hundred nodes it looks like it is a real improvement over linear text with jumps - we are after all now using _all_ the possible screen real estate.

foota 9 hours ago | parent | prev | next [-]

Ehhh. I think if you're trying to show the overall costs of something to someone that conclusion makes sense, but interactive flame graphs are the best way imo to look into things. Especially making use of sandwich views, which allow you to pivot the flame graph around some function to see callers and callees by cost.

Edit: I'll keep this up to share my embarrassment, but I missed entirely that the article was about disk space. I admit I only looked at the pictures haha.

alanbernstein 8 hours ago | parent | prev [-]

Why do treemaps suck?

Espressosaurus 7 hours ago | parent [-]

It's not as straightforward to compare area as sorted length.

Look at the example in the link and try to make sense of it.

delta_p_delta_x 10 hours ago | parent | prev | next [-]

Windows equivalent: WizTree[1].

https://diskanalyzer.com/download

Asooka 7 hours ago | parent | next [-]

I wish there was something as fast as WizTree for Linux.

forrestthewoods 9 hours ago | parent | prev [-]

WizTree is super great. Strong recommend.

dietr1ch 4 hours ago | parent | prev | next [-]

Side note: To anyone that reaches out for du and ncdu from time to time. I recommend checking out `dua` (and `dua interactive`). It's way faster on my SSDs

lsh0 4 hours ago | parent [-]

See also `gdu` for an `ncdu` more suited to SSDs: https://github.com/dundee/gdu

epistasis 10 hours ago | parent | prev | next [-]

Oh this is beautiful and I'm so glad it's been reposted because I missed it the first time.

Flamegraphs seem so much more interpretable and informative than the other plots there, at least to me personally. And I never would have thought to use them for this, because usually when I need to clean out disks or take care of storage it's time sensitive and I want to spend the minimum time figuring things out, and poor viz is enough to accomplish the goal.

An ongoing falmegraph of disk usage over time would be super helpful for many systems I'm working with right now.

jeffreygoesto 10 hours ago | parent | prev | next [-]

For profiling I like the dual representation of treemap and tree of https://kcachegrind.github.io/html/Home.html a lot. Addresses the criticized points of treemaps of the post (see percentage and estimate areas of sub-trees) better than the examples chosen there.

fourthark 8 hours ago | parent | prev | next [-]

It's not that hard to fix the area problem with sunburst charts, by decreasing the radius for outer rings.

E.g.

https://github.com/vasturiano/sunburst-chart

saagarjha 6 hours ago | parent | prev | next [-]

IMO the best UI for this kind of thing is an outline view, where you can expand nodes that you care about at any arbitrary nesting.

theodpHN 8 hours ago | parent | prev | next [-]

For a hierarchical view with expand/collapse capability, Icicle charts can be helpful:

https://plotly.com/python/icicle-charts/

jurakovic 10 hours ago | parent | prev | next [-]

For Windows there is SpaceSniffer. I highly recommend

https://www.uderzo.it/main_products/space_sniffer/

netsharc 8 hours ago | parent | prev | next [-]

I was analyzing my spending in 2025, one of these graphs could be interesting.

One could drill down e.g. Groceries > Drinks > Coca-Cola if one is so inclined...

btbuildem 8 hours ago | parent | prev | next [-]

It's kind of wild that we've not come up with another one (a better one) of these in nearly a decade.

29athrowaway 8 hours ago | parent | prev [-]

Brendan Gregg needs to release a GPU oriented system performance book.