Simon Cross schrieb am 01.08.2018 um 21:37:
On Wed, Aug 1, 2018 at 7:19 PM, wrote:
CFFI is much slower than CPython's C-API:
It's a bit unsurprising that CFFI is slower on CPython because it works on top of the C API (so it's an extra layer).
Under PyPy it does better because it's more of a first class citizen.
It's faster under PyPy because their JIT can understand and optimise it. Or, more specifically, its usage in jitted code, so you get unboxed native calls instead of Python API calls. CPython does not have a JIT, that's why it's slower there. Doesn't really have anything to do with the C-API as such.