[Python-Dev] PEP 393 Summer of Code Project

Victor Stinner victor.stinner at haypocalc.com
Wed Aug 24 00:38:00 CEST 2011


Le mardi 23 août 2011 00:14:40, Antoine Pitrou a écrit :
> - You could try to run stringbench, which can be found at
>   http://svn.python.org/projects/sandbox/trunk/stringbench (*)
>   and there's iobench (the text mode benchmarks) in the Tools/iobench
>   directory.

Some raw numbers.

stringbench:
"147.07 203.07 72.4 TOTAL" for the PEP 393
"146.81 140.39 104.6 TOTAL" for default
=> PEP is 45% slower

run test_unicode 50 times:
0m19.487s for PEP
0m17.187s for default
=> PEP is 13% slower

time ./python -m test -j4 ("real" time):
3m16.886s (334 tests) for the PEP
3m21.984s (335 tests) for default
... default has 1 more test!

Only 13% slower on test_unicode is *good*. There are still a lot of code using 
the legacy API in unicode.c, so it cam be much better.

stringbench only shows the overhead of the conversion from compact unicode to 
Py_UNICODE* (wchar_t*). stringlib does still use the legacy API.

Victor



More information about the Python-Dev mailing list