NumPy Performance Debate
Comments discuss NumPy's performance in Python numerical computing, emphasizing its C implementation for near-native speeds, and compare it to alternatives like Julia, Numba, Cython, or native C/C++ for optimization.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Because julia is a better language. Numpy is written in C, why use python when you can use C?
Isn't a lot of numpy implemented in C?
Very cool, examples look great. Any performance metrics (compared to NumPy) that are available?
Isn't using numpy just an example of custom C code for a python bottleneck?
At first I thought, "how could anything be slower than python?" And then I figured that you probably would've ported it to leverage things like numpy which makes a lot of operations into native code and takes advantage of highly optimized blas libs, etc.
NumPy is insanely fast for most use cases, I've (grudgingly) come to the conclusion that if NumPy doesn't hack it then I should re-think the problem or my way of solving it rather than to try to optimize that particular bit of code if it isn't meant for something that is going to be run in production on a large number of machines. Likely there are better uses of my time. It's interesting how what is nominally a scripting language can perform so well for compute intensi
why not just use numpy which is already in C?
What does this do that I can't already do with some combination of Numpy, Cython, and Numba?
But isn't what makes numpy efficient written in C?
Take a look at Numba for JIT.The primary drawback of Numpy alone is that you pay the memory-to-cache latency for every operation. Numba compiles into C on the fly. It makes Python fast when it matters.