Strange array.array performance

Aahz aahz at pythoncraft.com
Thu Mar 12 01:48:38 CET 2009


In article <mailman.324.1235098726.11746.python-list at python.org>,
Maxim Khitrov  <mkhitrov at gmail.com> wrote:
>
>Interesting, though I'm not able to replicate that last outcome. The
>string method is still the fastest on my machine. Furthermore, it
>looks like the order in which you do the multiplication also matters -
>(8 * size * '\0') is faster than ('\0' * 8 * size). 

That's not surprising -- the latter does two string multiplication
operations, which I would expect to be slower than int multiplication.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"All problems in computer science can be solved by another level of     
indirection."  --Butler Lampson



More information about the Python-list mailing list