[Numpy-discussion] strange sin/cos performance

Emmanuelle Gouillart emmanuelle.gouillart@normalesup....
Mon Aug 3 09:21:12 CDT 2009


> >>>> import numpy as np
> >>>> a = np.arange(0.0, 1000, (2 * 3.14159) / 1000, dtype=np.float32)
> >>>> b = np.arange(0.0, 1000, (2 * 3.14159) / 1000, dtype=np.float64)
> >>>> %timeit -n 10 np.sin(a)
> > 10 loops, best of 3: 8.67 ms per loop
> >>>> %timeit -n 10 np.sin(b)
> > 10 loops, best of 3: 9.29 ms per loop

> OK, I'm curious, what OS/Python/Numpy are you using?

Sorry, I should have specified these information earlier:

OS: Linux Ubuntu 9.04 (running a Dual Core Intel Pentium E5200  @
2.50GHz)
Python: 2.6.2
Numpy: 1.2.1

Emmanuelle


More information about the NumPy-Discussion mailing list