py26-numpy is much slower than NumPy compiled for MacPython

Konrad Hinsen konrad.hinsen at fastmail.net
Tue Dec 7 23:21:37 PST 2010


On 07.12.2010, at 21:58, Konrad Hinsen wrote:

> 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

Update: I profiled both runs using Shark, and found that when using the MacPorts version, 57% of the total time is spent in function feclearexcept. In the MacPython run, this function doesn't even show up. This makes me suspect that the difference is in the handling of floating point numbers, specifically floating-point exceptions.

Konrad.



More information about the macports-users mailing list