It is possible that you hadn't typed the indexing variable yet, in which case the usual python speed gains would apply. The typing is what tells Cython to do the for loop in C. I don't know for sure though.