[SciPy-user] Python on Intel Xeon Dual Core Machine

Matthieu Brucher matthieu.brucher@gmail....
Tue Feb 5 04:15:29 CST 2008


>
> > The default is to use doubles on every platform (32 or 64 bits). BTW,
> > single precision is not faster than double precision for
> > not-vectorized loops (like additions), so if memory is not a problem,
> > Numpy's behaviour is the best ;). Using long doubles will not enhance
> > speed.
>
> I am a bit suprised by this affirmation: at C level, float is certainly
> faster than double. It of course depends on many parameters, but for
> example ATLAS is (almost) twice faster for big matrices with float
> compared to double, on my two main machines: a pentium 4 and a CoreDuo2,
> which have extremely different behaviours with regard to their FPU.
> AFAIK, the different is mainly due to memory pressure (at CPU level,
> float and double are roughly the same, but this is not the limitation on
> currently available CPU).
>

In fact, it depends on what PU is used. If it is the usual x87 FPU, the
floats are stored as doubles in the registers and they are both as fast. But
if you use SSE or SSE2 instructions, then floats can get faster. As you
said, if there are a lot of loads and stores, floats have the upper hand
over doubles. If you work a lot on small arrays, then this difference may
disappear.

Matthieu
-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080205/38f2c11d/attachment-0001.html 


More information about the SciPy-user mailing list