Re:Comparing the C FFI overhead in various programming langu...
by eesmith on Saturday May 26, 2018 @07:24AM
(#17161448)
I'm a Python programmer, so what I'm most interested in are Python and PyPy. Both with ctypes and with the cffi module.
[ Parent
| on HN ]
Re:Comparing the C FFI overhead in various programming langu...
by mlthoughts2018 on Saturday May 26, 2018 @09:55PM
(#17165099)
Here looks like a GitHub gist you could use to do it for cffi vs Cython in Python, and PyPy.
Re:Comparing the C FFI overhead in various programming langu...
by eesmith on Sunday May 27, 2018 @12:41AM
(#17165464)
Thanks! Yes, it does.
Re:Comparing the C FFI overhead in various programming langu...
by _pgmf on Saturday May 26, 2018 @09:57PM
(#17165103)
ctypes is pretty slow in my experience. Cython is a nice alternative. Native speed and datatypes where you need them, plain old python anywhere else.
Re:Comparing the C FFI overhead in various programming langu...
by eesmith on Sunday May 27, 2018 @12:40AM
(#17165459)
Yes, my experience with CPython is that ctypes is slower than writing (or generating, as is the case with Cython) the Python/C extension.
However, one advantage with ctypes is that it can work with other Python implementations, like PyPy.