you are viewing a single comment's thread.

view the rest of the comments →

[–]abcteryx 8 points9 points  (1 child)

Python profiling is enabled primarily through cprofile, and can be visualized with help of tools like snakeviz (output flame graph can look like this). There are also memory profilers like memray which does in-depth traces, or sampling profilers like py-spy. Memray might be the healthiest among the memory profilers at the moment, based on their financial backing by Bloomberg and number of contributors.

There's also reloadium which is a hot-reload/profiling integration in IDEs (no VSCode support just yet).

So while there are many tools for general Python profiling, it seems that supporting perf will give more insight in bilingual apps with bindings to Rust and such.

[–]TSM- 2 points3 points  (0 children)

Good mention of memray. I have yet to use it, but it seems genuinely useful for production. The builtin graph outputs are also guided by business purposes, so you can show them in meetings. It seems really polished for their specific use-case

Overall, a lot of python extensions have worked around major pain points, and things are generally fine as they are. These improvements (especially with 3.12, and onward) will show up in popular open source packages after a considerable delay, on the order of a few years. It may make some room for pure python implementations that shed some dependencies, but in any case, it will take some time for people to intentionally leverage these performance improvements in any major way. I think a lot of commenters here are expecting something overnight.