On Wed, Feb 13, 2013 at 1:28 AM, Christian Heimes <christian at python.org> wrote: > Am 12.02.2013 22:32, schrieb Antoine Pitrou: >> For the record, io.StringIO should be quite fast in 3.3. >> (except for the method call overhead that Guido is complaining >> about :-)) > > AFAIK it's not the actual *call* of the method that is slow, but rather > attribute lookup and creation of bound method objects. If speed is of > the essence, code can cache the method object locally: > > strio = io.StringIO() > write = strio.write > for element in elements: > write(element) > result = strio.getvalue() And this is a great example of muddying code in stdlib for the sake of speeding up CPython. Cheers, fijal
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