Are Matlab built-in functions written in a lower level language?

Why are the built-in functions in Matlab so much faster than the ones you write?

+6
source share
3 answers

yes, matlab alikes usually use wrapper functions for routines of linear algebra libraries written in a low-level language (usually Fortran ), such as BLAS , ATLAS or LAPACK .

you can read about it in here

also see this question if you are curious how much overhead the packaging costs (mostly not). the results are for C++ , python and numpy , but I believe that they also apply to Matlab.

+9
source

In short, because they will be written in native code (C / C ++), which will allow developers to access assembler data optimization, as well as the ability to use SSE and the like to try and parallelize operations within the CPU.

+1
source

Yes, in all likelihood, these matrix functions are written in C, C ++, or even on the assembly. C and C ++ code can even take advantage of SIMD (single instruction with multiple data), such as SSE (from Intel).

+1
source

Source: https://habr.com/ru/post/926976/


All Articles