flamelens: Flamegraph viewer in the terminal

165 points ysl_1

I made a flamegraph viewer in the terminal, flamelens:

https://i.redd.it/aaecxqgdaj9d1.gif

I find it convenient to be able to quickly inspect the profiling results without having to leave the terminal, vs the regular workflow of generating an SVG file and then opening it in the browser (especially when in a remote server where a browser is not available).

There is also a fun experimental option to view a "live" flamegraph of a running Python program given its pid, thanks to the excellent py-spy profiler.

Appreciate any feedback!