4 ms·
Even native python is not as slow as people expect. And scientific languages are terribly slow, see for example loops in Matlab, which are terribly slow.
by antoinealb 5y ago
Even native python is not as slow as people expect. And scientific languages are terribly slow, see for example loops in Matlab, which are terribly slow.
- sidpatil 5y agoFORTRAN, the OG of scientific languages, is not slow. In fact, that's why it's still used to this day.
- antoinealb 5y agoThat's true, i was more thinking of scientific interpreted languages, a la R, Mathematica, matlab
- dralley 5y agoIn fact it may well be the fastest language - although it's hard to compete with the sheer number of man hours spent on C/C++ compilers.
- adgjlsfhk1 5y agowhile it isn't inherently slow, all the open source compilers are missing a lot of modern improvements. The default libm in particular is often a few times slower than those provided by Julia.
- teleforce 5y agoIt is not the compiler per se, it is mostly down to the design of the language itself. D language based numerical library has already beaten popular Fortran based numerical library OpenBLAS/Lapack for several years now [1]. [1]Numeric age for D: Mir GLAS is faster than OpenBLAS and Eigen: http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/glas-gemm-benchmark.html http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/...
- esjeon 5y agoMathematica is the worst when it comes to pure number crunching, because they use unstructured arrays. Much more flexible, but much slower.
- carry_bit 5y agoMathematica also has the more specialized packed and numeric array types.
- fault1 5y agonative python is indeed quite slow relative to anything compiled, especially when you want to use pure python for hot loops. it's really the saving grace of cython (or alternatives) that makes python tractible for a lot of scientific computing. I'll agree that mathematica was really slow (but very expressive) when I played with it last. I think this comes down to it's lispy heritage. julia is an example of a lang that is fast, but even it can be slow because of GC depending on the workload.
- docfort 5y agoMATLAB has had a JIT at the function level for several years now that alleviates specifically that pain. But most guides still focus on vectorization for optimization.
- nick__m 5y agoLoops and other general purpose programming constructs are afterthoughts in Matlab! It's not really a general purpose language, it is at it's core a numerical computation language, it's made for matrices and vectors operations. If a Matlab user don't need Simulink or one of it's numerous costly toolboxes, this user should give Julia a try.