py26-numpy is much slower than NumPy compiled for MacPython

Konrad Hinsen konrad.hinsen at fastmail.net
Tue Dec 7 12:58:56 PST 2010


Somewhat by accident I noticed an enormous speed difference in basic NumPy operations between my MacPorts installation (py26-numpy) and the NumPy 1.5.1 binaries from the NumPy sourceforge site used with MacPython 2.6, also downloaded as a binary.

~/projects/solar_system> /usr/local/bin/python bench2.py 
CPU time: 16 s
~/projects/solar_system> /opt/local/bin/python bench2.py 
CPU time: 45 s

The script bench2.py is attached. I wonder what could cause this big difference. No BLAS operations are used, so the difference in BLAS implementation should not matter. In fact, all that happens is allocation of a big array and lots of float subtractions.

Did anyone look into this already?

Konrad.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bench2.py
Type: text/x-python-script
Size: 249 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20101207/e168bd23/attachment.bin>
-------------- next part --------------




More information about the macports-users mailing list