Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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?

Answers (1)

Murugavel Sivagnanam
Murugavel Sivagnanam on 12 Jan 2011
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!