[pypy-dev] Question about extension support
john.m.camara at gmail.com
Wed Mar 26 02:48:27 CET 2014
More up to date information can be found on the FAQ page
The best approach for PyPy is either use a pure Python module if possible
or use a cffi wrapped extension instead of an extension that uses the
CPython CAPI. Often CPython CAPI extensions are wrapping some c library.
Creating a cffi wrapper for the library is actually much simpler than
writing a CPython CAPI wrapper. Quite a few CPython CAPI extensions have
already been wrapped for cffi so make sure to search for one before
creating your own wrapper. If you need to create a wrapper, refer to the
cffi documentation at
Extensions wrapped with cffi are compatible with both CPython and PyPy. On
CPython the performance is similar to what you would get if you used
ctypes. How every, under PyPy, the performance is much closer to a native
C call plus the overhead for releasing and acquiring the gil.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pypy-dev