Re:Scalene: a high-performance, high-precision CPU and memor...
by emeryberger on Thursday January 09, 2020 @03:48PM
(#22005532)
Scalene author here. I was not aware of either tool - many thanks for the pointers! I just tried py-spy (I will try PyFlame on a Linux box momentarily). It's pretty cool, though having to run it as root on OS X isn't great (scalene runs without the need for root privileges; the CPU profiling part is pure Python). Py-spy does appear to efficiently track CPU perf at the line granularity (and does a lot of other stuff). It does a lot of things that scalene does not do, but not memory profiling. Also, I personally prefer scalene's line-level display of annotated source code vs. the flame graphs, but YMMV.
> While pyflame is a great project, it doesn't support Python 3.7 yet and doesn't work on OSX, Windows or FreeBSD.
I wonder how the CPU profiling in Scalene is different. It does not mention PyFlame or py-spy at all in the Readme. Of course, the memory profiler is some nice extra.