Cythonized function unexpectedly slow
问题 I wanted to speed up a function that I'm using a lot and I though about using cython. However, after trying all the possible cython optimizations that I've been able to find in the documentation, the cython code is about 6 times slower than the python+numpy function. Disappointing! This is my test code: (forward1 is the python function, forward2 is the cython function) #geometry.py def forward1(points, rotation, translation): '''points are in columns''' return np.dot(rotation, points -