フィルターのクリア

How much codegen speed up the performance ? Please give numbers!!!

4 ビュー (過去 30 日間)
Alvaro
Alvaro 2017 年 2 月 7 日
編集済み: Adam 2017 年 2 月 7 日
Hello, Could you please validate my understanding. What does mcc ? mcc packages the matlab code in only file. So the execution is still based on the interpretation of the matlab language (no compilation). So there is no runtime speed improvement. Right ?
Assuming the vectorization is done, the algorithm is optimized...
To improve speed performance i must used codegen as described extensively on this site.
But quantitatively speaking, i would like to estimate the speeed will be increased. Are there some benchmark somewhere ?
Will the overall time execution will be divided by 2 or 10 or 50 ? I can see a lot of numbers on internet.
Could someone give me some indications ?
Very best regards Al

回答 (1 件)

Adam
Adam 2017 年 2 月 7 日
編集済み: Adam 2017 年 2 月 7 日
Matlab compiler creating an executable may have some effects on speed (either faster or slower), but as far as my experience goes timings are comparable between a compiled app and code run in Matlab so you are correct on that, to the best of my knowledge.
To estimate speed-up of codegen in a generic manner is impossible though. It depends on many factors, most obviously the code that you are generating the C++ code for. Some code in Matlab is more optimised than others, especially builtin functions. Some of these have gone through many iterations of optimisation.
If you write your own Matlab code with a bunch of nested for loops this will likely be very slow in Matlab, but C++ works fine with for loops so using codegen to turn it into C++ code will likely give a huge speedup there. But it is all qualitative. For all I know some code may even be slower if you use codegen than run the Matlab version if the latter is highly optimised.
You would have to test it for yourself on the code you actually want to use it for.
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 7 日
For example, generating code for linear algebra is almost certain to be slower than using MATLAB, as MATLAB calls upon the highly optimized MKL or BLAS or LINPAK that uses multiple threads and which pay careful attention to buffering and cache effects.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by