Strange array.array performance

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Feb 19 20:23:14 CET 2009


En Thu, 19 Feb 2009 16:52:54 -0200, Maxim Khitrov <mkhitrov at gmail.com>  
escribió:

> input = array('B', range(256) * 10000)
>
> # Case 1
> start = clock()
> data1 = array('B', input)
> print format(clock() - start, '.10f')

> That seems very wrong. In the end, all arrays have the same data, but
> by specifying it in the constructor the creation process takes over
> 350x longer than the other two methods. Is this a bug, or is there
> some valid reason for it?

It's a known issue: http://bugs.python.org/issue5109

-- 
Gabriel Genellina




More information about the Python-list mailing list