3 ms·
You are looking at a ten fold slow down to use Numpy. This is a extremely time sensitive software. Mentioning wrappers even adds to the over head. Here is NASA
by baldfat 11y ago
You are looking at a ten fold slow down to use Numpy. This is a extremely time sensitive software. Mentioning wrappers even adds to the over head.
Here is NASA's benchmarks using Fortan vs MATLAB vs Numpy vs Java. pretty evident that Fortran blew everything away.
https://modelingguru.nasa.gov/docs/DOC-1762 https://modelingguru.nasa.gov/docs/DOC-1762
- kragen 11y agoThe slowdown from using Numpy (or Octave or whatever) instead of Fortran can be anywhere from 100× to 1.0000000001×. It depends almost entirely on how much of your compute time is spent inside standard computations on large arrays. If your arrays are tiny, or you're doing irregular things to them and can't figure out how to vectorize them, figure 100×. But there are lots of Numpy programs that fire off a few dozen Numpy calls per second, so the bulk of the code executed is Fortran (or maybe C) in any case. The extra microsecond to interpret the Python bytecodes to fire off the call just isn't significant. More typical is about 3× or 5×, due to iterating over the data many times (once per Numpy call) instead of once, thus bottlenecking on main-memory bandwidth.