5 ms·
For folks looking for a good modern profiling tool for Python codebases: my current favourite is Scalene [0], which allows profiling CPU/GPU and memory usage in
by tbabej 5y ago
For folks looking for a good modern profiling tool for Python codebases: my current favourite is Scalene [0], which allows profiling CPU/GPU and memory usage in a performant way. The author gave a talk about it on last PyCon US [1].
[0]: https://github.com/plasma-umass/scalene https://github.com/plasma-umass/scalene
[1]: https://www.youtube.com/watch?v=nrQPqy3YY5A https://www.youtube.com/watch?v=nrQPqy3YY5A
- itamarst 5y agoScalene is pretty neat, yes. The memory profiling, however, is more useful when you're trying to find memory leaks. This is a common scenario in web apps, say. If your goal is to find peak memory usage, which is what you care about in data processing batch processes, Fil is probably a better choice (https://pythonspeed.com/fil https://pythonspeed.com/fil).
- singhrac 5y agoHaving done a serious amount of Python memory profiling work in the past, both Fil and Scalene are useful tools. Add them to your list along with runsnakemem and the high level memory-profiler. On the time profiling side I highly recommend py-spy and pyflame (a little less updated).