[pypy-dev] libgmp

Maciej Fijalkowski fijall at gmail.com
Fri Feb 24 03:18:36 CET 2012


On Thu, Feb 23, 2012 at 6:56 PM, Timothy Baldridge <tbaldridge at gmail.com> wrote:
> For a project I'm working on, I'd like to have support for gmp in
> pypy. I have a ctypes pypy module, but from what I understand, pypy's
> ctypes are a bit slow compared to CPython. What's the best way to get
> access to get access to libgmp from python? Would you be against a
> pull request that added libgmp as an RPython module?
>
> Thanks
>
> Timothy

Hi

PyPy's ctypes story is a kind of sad one. There was an attempt to make
it fast, but it's definitely unfinished. If you hit the correct sweet
spot of ctypes, it's super-fast, much faster than cpython. If you
however don't, it's slow. Maybe you can show a concrete usecase and I
can try and speed it up?

I suppose ctypes is the advertised way of accessing C from PyPy for now.

Cheers,
fijal


More information about the pypy-dev mailing list