Re:D as a Better C
by innocenat on Wednesday August 23, 2017 @02:15PM
(#15083765)
But would that be faster than numpy? numpy in typical setup would use SIMD or other math kernel (mkl, blas, etc).
[ Parent
| on HN ]
It 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.
Oh 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