vmprof-python
vmprof-python copied to clipboard
ENH: Allow checking vmprof output in progress.
This PR isn't quite ready yet, but I thought I'd start early, then we can talk about the preferred approach as I'm hacking away. Related to #127.
Two improvements are made so far:
- Make the reader interface a little bit more abstract.
- When writing out only needed symbols, don't write the same symbol multiple times.
Reasoning:
- As a next step, we can have a far simpler implementation when it comes to handling incomplete profile reads - which we'll need if we want to be able to query an ongoing profiling run.
- To have those in-progress reads actually useful, we'll need to be able to force a symbol write before the profile is actually closed. The function for this is already exposed to the Python layer, even though it's not mentioned in the main docs. I haven't selected a way of doing that yet, but once that is in place, we definitely don't want to be forced to repeatedly write out the same virtual ips over and over again.
The current implementation of (2) seems slightly iffy to me, is it okay to use a PySet here, or should this be ported over to the khash thing? Any other comments? ;)