[Numpy-discussion] Multiple Boolean Operations
Andrea Gavana
andrea.gavana@gmail....
Sun May 25 04:22:37 CDT 2008
Hi Stefan & All,
On Sat, May 24, 2008 at 8:11 PM, Stéfan van der Walt wrote:
> Hi Andrea
>
> 2008/5/24 Andrea Gavana <andrea.gavana@gmail.com>:
>> Number Of Cells: 50000
>> ---------------------------------------------------------------------
>> | Rank | Method Name | Execution Time | Relative Slowness |
>> ---------------------------------------------------------------------
>> 1 NumPy 5 (Andrea) 0.00562803 1.00000
>> 2 NumPy 1 (Francesc) 0.00563365 1.00100
>> 3 NumPy 2 (Nathan) 0.00577322 1.02580
>> 4 NumPy 4 (Nathan-Vector) 0.00580577 1.03158
>> 5 Fortran 6 (James) 0.00660514 1.17361
>> 6 Fortran 3 (Alex) 0.00709856 1.26129
>> 7 Fortran 5 (James) 0.00748726 1.33035
>> 8 Fortran 2 (Mine) 0.00748816 1.33051
>> 9 Fortran 1 (Mine) 0.00775906 1.37864
>> 10 Fortran 4 {Michael) 0.00777685 1.38181
>> 11 NumPy 3 (Peter) 0.01253662 2.22753
>> 12 Cython (Stefan) 0.01597804 2.83901
>> ---------------------------------------------------------------------
>
> When you bench the Cython code, you'll have to take out the Python
> calls (for checking dtype etc.), otherwise you're comparing apples and
> oranges. After I tweaked it, it ran roughly the same time as
> Francesc's version. But like I mentioned before, the Fortran results
> should trump all, so what is going on here?
I thought I had removed the Python checks from the Cython code (if you
look at the attached files), but maybe I haven't removed them all...
about Fortran, I have no idea: I have 6 different implementations in
Fortran, and they are all slower than the pure NumPy ones. I don't
know if I can optimiza them further (I have asked to a Fortran
newsgroup too, but no faster solution has arisen). I am not even sure
if the defaults f2py compiler options are already on "maximum
optimization" for Fortran. Does anyone know if this is true? Maybe
Pearu can shed some light on this issue...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
More information about the Numpy-discussion
mailing list