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
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