Compiled App running extremely slow in the MATLAB runtime environment

Hello
I composed a code on Ubuntu Desktop 22.04LTS using Matlab R2024a, and it takes 236 seconds to execute.
Then i compiled it into a linux app and install Matlab runtime 2024a on the same computer (bare metal, not virtual machine, i7-6790K, 16GB RAM),
but the app executed extremely slow with the Matlab runtime, after serveral loops, its outputs seens stopped, but the thread is still running.
I didn't using Parallel Computing Toolbox in my code.

3 件のコメント

Walter Roberson
Walter Roberson 2024 年 7 月 26 日
Could you confirm that you used MATLAB Compiler (which would be in keeping with using MATLAB Runtime), and that you did not use MATLAB Coder ? There are reasons why MATLAB Coder can turn out slower.
xin
xin 2024 年 7 月 26 日
I used MATLAB compiler, but not use MATLAB coder,
Execute code in MATLAB editor is fast, but compiled App with MATLAB runtime did not.
Andreas Goser
Andreas Goser 2024 年 7 月 29 日
In general, you can expect very similar execution times in MATLAB and the compiled application in the runtime.
Have you tried isolating the issue? Does it happen only in R2024a? Did you test it with a simple application rather than yours?

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

回答 (1 件)

Gojo
Gojo 2024 年 9 月 12 日
編集済み: Gojo 2024 年 9 月 12 日

0 投票

Hey Xin,
I understand that the compiled application is having higher execution time as compared to the native MATLAB scripts.
As stated by @Andreas Goser, MATLAB and the compiled application executed via the runtime should perform with similar execution time in most of the cases. However, please note that once the application is compiled as a standalone executable, it would be treated as any other application running over your OS.
There could be mutiple reasons for the slow execution of the compiled app:
I hope this helps!

1 件のコメント

Sylvain
Sylvain 2025 年 4 月 23 日
Hi Gojo, regarding your last bullet points: how can we determine is the application is using the Java Virtual Machine (JVM). Can we deactivate it in the app compiler ? (I could not see any option)

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

製品

リリース

R2024a

質問済み:

xin
2024 年 7 月 26 日

コメント済み:

2025 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by