[HN Gopher] Memray: a memory profiler for Python
       ___________________________________________________________________
        
       Memray: a memory profiler for Python
        
       Author : shcheklein
       Score  : 129 points
       Date   : 2022-04-20 19:54 UTC (3 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | [deleted]
        
       | uniqueuid wrote:
       | 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.
        
         | kungfufrog wrote:
         | https://github.com/plasma-umass/scalene check out scalene!
        
         | erwincoumans wrote:
         | 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
        
           | knlb2022 wrote:
           | 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).
        
           | ogrisel wrote:
           | viztracer can create traces for python programs. Not sure
           | about async-io awareness though.
        
             | ogrisel wrote:
             | Actually it has explicit support for async task based
             | reporting:
             | 
             | https://github.com/gaogaotiantian/viztracer#async-support
        
         | mjsir911 wrote:
         | 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/
        
           | uniqueuid wrote:
           | Thanks, that looks useful!
        
         | zackangelo wrote:
         | Do you mean specifically for Python? There's this for async
         | Rust:
         | 
         | https://tokio.rs/blog/2021-12-announcing-tokio-console
        
       | shcheklein wrote:
       | A twitter thread with some screenshots and details -
       | https://twitter.com/1st1/status/1516859294896906241
        
       ___________________________________________________________________
       (page generated 2022-04-20 23:00 UTC)