2 ms·
I'm a Python programmer, so what I'm most interested in are Python and PyPy. Both with ctypes and with the cffi module.
by eesmith 8y ago
I'm a Python programmer, so what I'm most interested in are Python and PyPy. Both with ctypes and with the cffi module.
- mlthoughts2018 8y agoHere looks like a GitHub gist you could use to do it for cffi vs Cython in Python, and PyPy. < https://gist.github.com/brentp/7e173302952b210aeaf3 https://gist.github.com/brentp/7e173302952b210aeaf3 >
- eesmith 8y agoThanks! Yes, it does.
- coleifer 8y agoctypes is pretty slow in my experience. Cython is a nice alternative. Native speed and datatypes where you need them, plain old python anywhere else.
- eesmith 8y agoYes, 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.