Compiling with Matlab instead of interpreting
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi,
I'm looking to compare different coding software (Matlab, Python and Labview) to know which one would be the most adept for my need. I wanted to write the same heavy calculations in the three language and see which one runs faster. I would be making a custom function and calling it a hundred times and see how long it took to execute.
To do so, I wanted to optimize my code the best I can. To my understanding, Matlab is an interpreter. He will go line by line traducting the code for the computer to execute it. I wanted to know if it was possible to compile the code in advance in a way to make it execute as fast as a compiler.
Thank you
RMT
댓글 수: 0
채택된 답변
Bruno Luong
2018년 11월 12일
편집: Bruno Luong
2018년 11월 12일
MATLAB calls FFTW library behind the scene, so if you are doing heavily FFT for convolution, there is not much speed penalty.
I recently code an algorithm in C and invokes FFTW; I can attest it's pretty hard to beat MATLAB.
It hard to say anything about speed. It depends not only which "language" you select but also where as you are beginer or expert.
In MATLAB, it can play a great role.
댓글 수: 9
Bruno Luong
2018년 11월 13일
You need to pay attention to threading.
Labview is heavily multi-thread and MATLAB is mostly not threadsafe. That can create serious locking if you call stuff asynchronuously..
추가 답변 (2개)
Image Analyst
2018년 11월 12일
댓글 수: 1
Bruno Luong
2018년 11월 12일
MATLAB compiler actually doesn't compile anything. It just encrypt/package the source code to run under the runtime.
In this perspective, the speed gain is 0.
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!