13 ms·
In my experience, pypy works with basically everything these days. I remember having some struggles with a weird fortran based extension module a few years ago,
by eyegor 3y ago
In my experience, pypy works with basically everything these days. I remember having some struggles with a weird fortran based extension module a few years ago, but it might work now too.
Most c extension modules should work in pypy, there's just a performance hit depending on how they're built (cffi is the most compatible).
https://doc.pypy.org/en/latest/faq.html#do-c-extension-modules-work-with-pypy https://doc.pypy.org/en/latest/faq.html#do-c-extension-modul...
- nextaccountic 3y agoThe point of using C extensions is to have better performance. Python is already slow in general; code that use such extensions typically depend on this performance to not be unbearable (such as data science) People wanting to use Pypy usually do so because they want better performance. Having a performance hit while using pypy is disconcerting. I was speculating that in the future, C extensions in pypy would be faster, but I now see that the GIL is actually unrelated to this performance hit. Anyway it's really a pity.
- im3w1l 3y agoI get what you are saying, but normally this wouldn't matter too much right? You will have a small number of calls into the C-extension that together do a lot of work. So as a percentage the ffi-overhead is small.
- remram 3y agoC extensions are fast if you use cffi. It's when it has to emulate CPython to run extensions written against CPython, that it is slow. Please do not phrase that as a failure of Pypy. That is so weird.