On Feb 27, 2004, at 4:12 AM, Raymond Hettinger wrote: > [Bob Ippolito] >> Currently, it seems that ''.join is faster than cStringIO.writelines >> anyway, even if you just pass it a big list. > > I suspect something wrong with your timing suite. Under the hood, > cStringIO.writelines() actually is ''.join(). It appears that the > whole comparison is circular. Circular in that "ends up doing approximately the same thing but has a lot more overhead" kind of way ;)... I think the difference is easily explained by: * N calls to join2 * N StringIO() * N StringIO.writelines * N StringIO.getvalue * N StringIO dealloc * [ probably also memcpy's 2 or 3 times as much ] -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/python-dev/attachments/20040227/2f05c7b9/smime-0001.bin
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