On 09/07/13 01:41, Antonio Cuni wrote:
Hello Eleytherios,
On 07/04/2013 08:12 AM, Antonio Cuni wrote:
Il giorno 03/lug/2013 18:17, "Amaury Forgeot d'Arc" <amauryfa@gmail.com <mailto:amauryfa@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 :-)
could you try to rerun your benchmark on the improve-str2charp branch please? The benchmarks on speed.pypy.org shows some important speedup in e.g. twisted_tcp or raytrace_simple, which seems to contain a lot of write I/O, so it might help your case as well:
The times that we got with improve-str2charp, are a little worse than the previous nightly build that i had tried with in my previous email. I have rerun the benchmark and the times (best of 3 runs) are: CPython 2.7.3: 14.173 sec PyPy nightly 3/7/2013: 32.105 sec PyPy improve-str2charp: 34.044 sec Regards, l.