[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-08-14 Thread Victor Stinner
That looks pretty cool! I'm really happy that PEP 445 hooks are reused for something different than tracemalloc ;-) Victor Le mer. 14 août 2019 à 20:12, Yonatan Zunger a écrit : > > Update: Thanks to Victor's advice and the PEP445 hooks, I put together a > pretty comprehensive logging/sampling

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-08-14 Thread Yonatan Zunger
Update: Thanks to Victor's advice and the PEP445 hooks, I put together a pretty comprehensive logging/sampling heap profiler for Python, and it works great. The package is now available via pip for anyone who needs it! On Thu, Jun 27, 2019 at 4:21 PM Yonatan Zu

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Victor Stinner
Le ven. 28 juin 2019 à 01:03, Yonatan Zunger a écrit : > Although while I have you hear, I do have a further question about how > tracemalloc works: If I'm reading the code correctly, traces get removed by > tracemalloc when objects are free, which means that at equilibrium (e.g. at > the end o

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Yonatan Zunger
Well, then. I think I'm going to have some fun with this. :) Thank you! On Thu, Jun 27, 2019 at 4:17 PM Victor Stinner wrote: > Le ven. 28 juin 2019 à 01:03, Yonatan Zunger a écrit : > > Although while I have you hear, I do have a further question about how > tracemalloc works: If I'm reading

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Yonatan Zunger
It's similar, but not quite the same -- I was just trying to see if I could build a neatly Pythonic library to do the conversion. The CPU profilers are basically building a dict from (filename, lineno, funcname) to a tuple (from a comment in profile.py): [0] = The number of times this function

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Victor Stinner
Hi, I designed tracemalloc with Charles-François Natali in PEP 454. The API is a lightweight abstraction on top of the internal C structures used by the C _tracemalloc module which is designed to minimize the memory footprint. I'm not aware of the pstats format. Adding a new tracemalloc.dump_psta