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?
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