[Numpy-discussion] strange sin/cos performance

Charles R Harris charlesr.harris@gmail....
Tue Aug 4 21:42:40 CDT 2009


On Tue, Aug 4, 2009 at 7:18 PM, Jochen <cycomanic@gmail.com> wrote:

> Hi all,
> I see something similar on my system.
> OK I've just done a test. System is Ubuntu 9.04 AMD64
> there seems to be a regression for float32 with high values:
>
> In [47]: a=np.random.rand(10000).astype(np.float32)
>
> In [48]: b=np.random.rand(10000).astype(np.float64)
>
> In [49]: c=1000*np.random.rand(10000).astype(np.float32)
>
> In [50]: d=1000*np.random.rand(1000).astype(np.float64)
>
> In [51]: %timeit -n 10 np.sin(a)
> 10 loops, best of 3: 251 µs per loop
>
> In [52]: %timeit -n 10 np.sin(b)
> 10 loops, best of 3: 395 µs per loop
>
> In [53]: %timeit -n 10 np.sin(c)
> 10 loops, best of 3: 5.65 ms per loop
>
> In [54]: %timeit -n 10 np.sin(d)
> 10 loops, best of 3: 87.7 µs per loop
>
> In [55]: %timeit -n 10 np.sin(c.astype(np.float64)).astype(np.float32)
> 10 loops, best of 3: 891 µs per loop
>

Is anyone with this problem *not* running ubuntu?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090804/14b749e2/attachment.html 


More information about the NumPy-Discussion mailing list