[Numpy-discussion] strange sin/cos performance

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Aug 3 10:44:51 EDT 2009


On Mon, Aug 3, 2009 at 10:21 AM, Emmanuelle
Gouillart<emmanuelle.gouillart at normalesup.org> wrote:
>> >>>> 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
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>

just for reference:
 on a plain single core WindowsXP (32bit) notebook with official numpy
1.3.0, I get with some variation

sin float32 0.0963996820825
sin float64 0.164140135129
cos float32 0.124504371366
cos float64 0.149174266562

Josef



More information about the NumPy-Discussion mailing list