Final Cython optimization.