News for hackers. Stuff that matters.
Re:Memray: a memory profiler for Python by uniqueuid on Wednesday April 20, 2022 @04:35PM (#31102636)
Tangential question: Does anybody have a good recommendation for a profiler that works well with massively async codebases?

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.

Re:Memray: a memory profiler for Python by mjsir911 on Wednesday April 20, 2022 @04:56PM (#31102891)
I've had good luck with yappi for debugging asynchronous code, not really focused on memory usage but walltime & such.

https://pypi.org/project/yappi/

Re:Memray: a memory profiler for Python by uniqueuid on Wednesday April 20, 2022 @05:02PM (#31102965)
Thanks, that looks useful!
Re:Memray: a memory profiler for Python by kungfufrog on Wednesday April 20, 2022 @06:56PM (#31104122)
Re:Memray: a memory profiler for Python by Jarwain on Wednesday April 20, 2022 @10:56PM (#31105612)
+1 for scalene! I love how it breaks down consumption line-by-line, and it's worked very well in my async/multithreaded usecase
Re:Memray: a memory profiler for Python by erwincoumans on Wednesday April 20, 2022 @05:36PM (#31103361)
I like open source Perfetto UI (formerly Google Chrome about::/tracing) Wrote my own timing trace json export for Python and C++, across threads and processes. The docs have some pointers to creating your own traces with the Tracing SDK.

See https://ui.perfetto.dev

Re:Memray: a memory profiler for Python by knlb2022 on Wednesday April 20, 2022 @06:09PM (#31103726)
I built https://github.com/kunalb/panopticon to export perfetto/chrome compatible traces and also draw arrows between async functions. (I think the arrows are only supported in about://tracing though).
Re:Memray: a memory profiler for Python by sterlinm on Friday April 22, 2022 @10:13PM (#31130742)
Looks like you can use magic-trace with a perfetto based UI. https://github.com/janestreet/magic-trace
Re:Memray: a memory profiler for Python by ogrisel on Wednesday April 20, 2022 @05:47PM (#31103479)
viztracer can create traces for python programs. Not sure about async-io awareness though.
Re:Memray: a memory profiler for Python by ogrisel on Wednesday April 20, 2022 @05:49PM (#31103495)
Actually it has explicit support for async task based reporting:

https://github.com/gaogaotiantian/viztracer#async-support

Re:Memray: a memory profiler for Python by zackangelo on Wednesday April 20, 2022 @04:57PM (#31102902)
Do you mean specifically for Python? There's this for async Rust:

https://tokio.rs/blog/2021-12-announcing-tokio-console

Re:Memray: a memory profiler for Python by p403n1x87 on Thursday April 21, 2022 @09:44AM (#31109285)
This should work with anything https://github.com/P403n1x87/austin