I tested the Wallis function to compute PI using 3 optimizations, the results are in my computer:
-
NUMBA: %timeit wallis(10000) The slowest run took 1421.40 times longer than the fastest. This could mean that an intermediate result is being cached. 10000 loops, best of 3: 118 µs per loop
-
NUMPY: %timeit wallis_np(10000) The slowest run took 8.83 times longer than the fastest. This could mean that an intermediate result is being cached. 10000 loops, best of 3: 79.9 µs per loop
-
C: %timeit wallis_c(10000) 10000 loops, best of 3: 108 µs per loop