[Numpy-discussion] About speed vs math...

Jerome Kieffer Jerome.Kieffer at esrf.fr
Mon Jun 3 01:29:42 EDT 2013


I am giving some introduction tutorials to numpy and we notices a big
difference in speed between nuumpy and math for trigonometric

In [3]: %timeit numpy.sin(1)
100000 loops, best of 3: 2.27 us per loop

In [4]: %timeit math.sin(1)
10000000 loops, best of 3: 92.3 ns per loop

While not surprising, I did not expect numpy to be so much slower (25x)...

Is this normal ?
Jérôme Kieffer
Data analysis unit - ESRF

More information about the NumPy-Discussion mailing list