[pypy-issue] [issue1010] numpypy: commit the code for array_equal

Dmitrey tracker at bugs.pypy.org
Thu Jan 19 20:49:58 CET 2012


Dmitrey <dmitrey15 at ukr.net> added the comment:

numpypy ndarray.flat doesn't work properly with indexation, but a walkaround has
been implemented and is available at http://pastebin.com/tg2aHE6x
Some speed tests:
1) in CPython numpy for arrays of lenght 100000, 100 times:
classic numpy array_equal time elapsed (on different arrays): 0.07728
Alternative array_equal time elapsed (on different arrays): 0.00056
classic numpy array_equal time elapsed (on same arrays): 0.11163
Alternative array_equal time elapsed (on same arrays): 9.09458
2) in current PyPy:
Alternative array_equal time elapsed (on different arrays): 0.00133
Alternative array_equal time elapsed (on same arrays): 0.95038
Since usually different arrays come to the func array_equal, this approach (w/o
logical_and and allocating memory for its input) seems to be better.

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1010>
________________________________________


More information about the pypy-issue mailing list