Info

此问题已关闭。 请重新打开它进行编辑或回答。

Why does my MATLAB Builder JA code run slower when run on the EDT in MATLAB Builder JA 2.0.4 (R2009b)

1 次查看(过去 30 天)
If I run MATLAB Builder JA code in the main body of my pplication or on a "normal" separate Thread; the code executes about as fast as in MATLAB. When I use a thread on the EDT however, I notice the methods take much longer to complete. What is causing this?

回答(1 个)

Murugavel Sivagnanam
To prevent GUIs from locking up when calling into a MATLAB Builder JA created class, the com.mathworks.toolbox.javabuilder pacakge manually allows other threads on the EDT to execute first. This will lead to your own thread on the EDT being interrupted which leads to a decrease in performance.
So apart from the fact that running CPU intensive operations (which your MATLAB routines usually are) on the EDT is not a good idea in general (as it will lead to sluggish GUI behavior). You also should not run the MATLAB Builder JA code on the EDT as it will decrease its performance

Community Treasure Hunt

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

Start Hunting!

Translated by