filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

PyPy Support

Open thedrow opened this issue 5 years ago • 2 comments

Is PyPy support planned? Is it currently not feasible? If so, how can we help make it feasible?

thedrow avatar Jun 23 '20 08:06 thedrow

I haven't really thought about PyPy. Theoretically it should be possible.

The way Fil works is that there is a fairly generic Rust library that does all the data structure work: keeping track of allocations and dumping them to SVG.

Then, there's _filpreload.c that:

  1. Overrides malloc and friends and forwards it to the Rust code. This bit would apply to PyPy too, or really to other programming languages.
  2. Efficiently figures out what the current callstack is when an allocation/free happens. This bit is highly CPython-specific, and is what allows Fil to be not too slow.

So that last bit is what would need to be rewritten in a PyPy-specific way.

itamarst avatar Jun 23 '20 12:06 itamarst

That second part of _filpreload.c is currently being rewritten (#18). Once that is done, a good next step would be to split _filpreload.c into two, so there's a clear boundary between generic code and CPython-specific code.

itamarst avatar Jun 23 '20 12:06 itamarst