4 ms·
The 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 perform
by nextaccountic 3y ago
The 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.