A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2011-October/113808.html below:

[Python-Dev] RFC: Add a new builtin strarray type to Python?

[Python-Dev] RFC: Add a new builtin strarray type to Python? [Python-Dev] RFC: Add a new builtin strarray type to Python?Victor Stinner victor.stinner at haypocalc.com
Mon Oct 3 15:31:23 CEST 2011
Le 03/10/2011 04:19, Victor Stinner a écrit :
> I restored this hack in Python 3.3 using PyUnicode_Append() in ceval.c and by
> optimizing PyUnicode_Append() (try to append in-place). str+=str is closer
> again to ''.join:
>
> str += str: 696 ms
> ''.join():  547 ms
>
> I disabled temporary the optimization for wstr string in PyUnicode_Resize()
> because of a bug. I disabled completly resize on Windows because of another
> bug.

Ok, bugs fixed, all "resize" optimizations are now enabled:

Python 3.3
str += str    : 119 ms
''.join()     : 130 ms
StringIO.join : 147 ms
StringBuilder : 404 ms
array('u')    : 979 ms

Hum, str+=str is now the fastest method, even faster than ''.join() !? 
It's maybe time to optimize str.join ;-)

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4