[Numpy-discussion] fast_any_all , a trivial but fast/useful helper function for numpy

Graeme B. Bell grb at skogoglandskap.no
Thu Sep 5 04:54:32 EDT 2013



Hi Julian,

Thanks for the post.  It's great to hear that the main numpy function is improving in 1.8, though I think there is still plenty of value here for performance junkies :-)   

I don't have 1.8beta installed (and I can't conveniently install it on my machines just now). If you have time, and have the beta installed, could you try this and mail me the output from the benchmark?  I'm curious to know. 

# git clone https://github.com/gbb/numpy-fast-any-all.git
# cd numpy-fast-any-all
# python test-fast-any-all.py

Graeme


On Sep 4, 2013, at 7:38 PM, Julian Taylor <jtaylor.debian at googlemail.com> wrote:

>> 
>> The result is 14 to 17x faster than np.any() for this use case.*
> 
> any/all and boolean operations have been significantly speed up by
> vectorization in numpy 1.8 [0].
> They are now around 10 times faster than before, especially if the
> boolean array fits into one of the cpu caching layers.




More information about the NumPy-Discussion mailing list