[pypy-dev] ctypes - PyPy 1.8 slower than Python 2.6.5

Antonio Cuni anto.cuni at gmail.com
Tue Feb 14 00:12:47 CET 2012

On 02/13/2012 03:22 PM, Sébastien Volle wrote:
> Thank you for your help Antonio. It seems a little indentation problem in the
> modified arp.py file you attached makes the main() loop to return after a
> single packet. I attached the updated version.

ops, I should have taken more care: actually, I was a bit surprised to see 
such a huge improvement, but didn't check more. This is what happens when you 
don't have tests to run ;-)

> The actual new figures are:
> CPython: ~580ms (~310ms with initial version)
> PyPy: ~1120ms (~1300ms with initial version)
> So, the manual cast of array to c_void_p makes the program around 2x slower on
> CPython, and only marginally faster on PyPy. PyPy spends now most its time in
> pointer.py:_cast_addr().

uhm, indeed, then my suggestion doesn't work very well.
I suppose that I should just add support for arrays to the fast path.


More information about the pypy-dev mailing list