A twitter thread with some screenshots and details - <a href="https://twitter.com/1st1/status/1516859294896906241" rel="nofollow">https://twitter.com/1st1/status/1516859294896906241</a>
I'm excited to see more profiling tools for Python!<p>This sounds like it does peak memory, which is critical for batch jobs, since that's the bottleneck. Memory is fundamentally different than performance in that it's a limited resource, instead of cumulative cost; making any part of the program faster almost always helps speed up the program (at least a little, or at least reduces CPU load), but optimizing non-peak memory has no impact. You have to be able to identify the peak in order to reduce memory usage.<p>If you want peak memory profiling for Python that also runs on macOS, check out <a href="https://pythonspeed.com/fil/" rel="nofollow">https://pythonspeed.com/fil/</a> (ARM support has some issues, but once I unpack my new Mac Mini I plan to fix it.)<p>Ways memray is better than Fil:<p>- Native callstacks.<p>- More kinds of reports, and ability to do custom post-processing of data.<p>- Much lower overhead (but not always, see reply).<p>- Subprocess support.<p>Fil I suspect has better flamegraphs: <a href="https://pythonspeed.com/articles/a-better-flamegraph/" rel="nofollow">https://pythonspeed.com/articles/a-better-flamegraph/</a><p>And if you're running Python batch jobs, and want both peak memory and performance profiling in production, check out Sciagraph: <a href="https://pythonspeed.com/sciagraph/" rel="nofollow">https://pythonspeed.com/sciagraph/</a><p>(You can probably cobble together something like Sciagraph with py-spy + memray, but you won't e.g. get timeline reports designed with batch jobs in mind.)
Want to chime in to say it's awesome that Bloomberg is releasing this product to the world. I don't think many financial organizations would even consider releasing anything as open source, even if it is as general purpose as this tool. My current one (HFT,MM) wouldn't go for it.<p>It also shows good engineering practices. I'd venture a guess that they are probably one of the better ones in the space.<p>Makes me want to work there! Maybe one day...
Tangential question: Does anybody have a good recommendation for a profiler that works well with massively async codebases?<p>My experience has been that the concurrent nature of coroutines can make it hard to reason about what's going on at a particular point in time. If you don't know how many things you're awaiting on at a specific moment (and what potential external stuff they may be interacting with), it's not exactly easy to identify memory usage of codepaths.
I've just put in production an app that intermittently can't allocate enough memory. Is this the best tool to debug it? I've never had to debug memory problems in Python.