Strange array.array performance

Maxim Khitrov mkhitrov at gmail.com
Thu Feb 19 20:53:59 CET 2009


On Thu, Feb 19, 2009 at 2:23 PM, Gabriel Genellina
<gagsl-py2 at yahoo.com.ar> wrote:
> 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

I see, thanks.



More information about the Python-list mailing list