I've been having trouble with speed while trying to utilise the gmpy module.
import numpy as np
import gmpy2 as gm
N = 1000
a = range(N)
%timeit [gm.sin(x) for x in a]
# 100 loops, best of 3: 7.39 ms per loop
%timeit np.sin(a)
# 10000 loops, best of 3: 198 us per loop
I was wondering if I could somehow speed this computation. I was thinking JIT or multiprocessing might help but I haven't figured out how to do it.
Any help would be greatly appreciated. If you want me to post more information please let me know.