[pypy-dev] ctypes create_string_buffer

Armin Rigo arigo at tunes.org
Sun Jan 12 21:53:56 CET 2014


Hi,

On Sun, Jan 12, 2014 at 6:28 AM, HY <lightdarkadmin at 163.com> wrote:
> I test 2f0d7dced731
> memory isn't large engross. but at the AMD 5000+ CPU, 5 secs CPU 100%.
> I think this has a BUG. :)

Yes :-)  You can see why it's slow by following the logic in pure
Python in lib_pypy/_ctypes/, maybe by using just pdb.  It's because
every character is individually converted to a ctypes object and back
before being stored into the string buffer.  I guess we could add a
special case to massively speed up the common "array-of-char.value =
string".


A bientôt,

Armin.


More information about the pypy-dev mailing list