[SciPy-user] Very slow comparison of arrays of integers

Brian Granger bgranger at scu.edu
Mon Jul 18 11:38:19 CDT 2005

On Jul 18, 2005, at 6:17 AM, Perry Greenfield wrote:

> Part of the problem may be due to the fact that your array is so  
> small. For small numbers of values, lists are probably faster.  Try  
> it with 100,000 values and see what the comparison looks like. If  
> it is still 15 times slower than there is a problem with Numeric.
> Perry Greenfield
> On Jul 18, 2005, at 1:10 AM, Brian Granger wrote:

It is as you expect.  For large arrays, Numeric is about 10 times  
faster than using Python lists (only in checking to see if two arrays  
are the same).  We have also tested an array comparison function  
written using weave.  For arrays smaller than 20,000, alltrue(a==b)  
is faster, but for larger arrays, the weaved code wins.

Thanks so much for the help!


More information about the SciPy-user mailing list