[pypy-dev] PyPy 2x slower using cpickle

Antonio Cuni anto.cuni at gmail.com
Thu Jul 4 08:12:16 CEST 2013


Il giorno 03/lug/2013 18:17, "Amaury Forgeot d'Arc" <amauryfa at gmail.com> ha
scritto:

> This is because of I/O.
> If I replace the file with a custom class which has an empty write()
method,
> pypy is twice faster than CPython.

Few days ago I discovered that there is an easy optimization for this. If
you look at how str2charp & friends are implemented, you see that we do an
RPython loop and copy char by char.
By contrast, things like string concatenation are implemented using memcpy
and are much faster (like 3-4 times, iirc).
Sorry if I don't give more precise pointer, but I'm on my mobile phone :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20130704/bd267786/attachment.html>


More information about the pypy-dev mailing list