[MERGE] rand_chars() optimization

Andrew Bennetts andrew at canonical.com
Mon Mar 12 00:27:37 GMT 2007


Dmitry Vasiliev wrote:
> John Arbash Meinel wrote:
[...]
> >
> >Can you benchmark it with the alternative, to see how much it helps?
> 
> Actually I've already tested list/generator comprehension versions and 
> surprisingly version which appending to a string was faster. But I 
> didn't test version with the mapping as a local variable.

Repeated appending to a string has been optimised in certain cases in CPython
2.4.  See http://www.python.org/doc/2.4.4/whatsnew/node12.html

-Andrew.




More information about the bazaar mailing list