3 ms·
But would that be faster than numpy? numpy in typical setup would use SIMD or other math kernel (mkl, blas, etc).
by innocenat 9y ago
But would that be faster than numpy? numpy in typical setup would use SIMD or other math kernel (mkl, blas, etc).
- lima 9y agoIt wouldn't. Pure Python code is never going to out-perform a low-level optimized C library. Especially not when comparing iterative vs vectorized code.
- no_wizard 9y agoOh no of course not. Sorry I must have missed something here. I was speaking specifically of iterating over/with values. Numpy is optimized for this kind of thing. Though you can help yourself out and make sure you python code is also optimized by using comprehensions and itertools I would suppose