Why does my application compiled with the MATLAB Compiler 4.1 (R14SP1) take a long time to start up?
3 views (last 30 days)
Show older comments
When I run my application compiled with the MATLAB Compiler 4.1 (R14SP1) from the command line, it takes longer to start up than it did in the R13 versions of the Compiler. I would like to know why startup times are longer.
Accepted Answer
MathWorks Support Team
on 14 Jan 2010
This enhancement has been incorporated in MATLAB Compiler 4.11 (R2009b). For previous product releases, read below for any possible workarounds:
As of R14, the MATLAB Compiler was completely changed to allow most MATLAB functionality to be compiled. This increase in scope of the Compiler necessitated a revamping of the engine that runs compiled applications. The new MCR is essentially a trimmed down version of MATLAB that is started with each call to a compiled application. Because of the power of the MCR, it takes longer to instantiate than did a compiled application from Release 13.
A best practice for writing compiled applications is to develop them so that they can run without being restarted often. That is, you can try to design your application so that it does not exit unless absolutely necessary. This way the MCR will not need to be initialized often.
If the MCR is installed on a network drive, the initialization time will be slower than when having the MCR on a local drive, as a local hard drive is much faster than any network connection.
Also, if your compiled application does not use Java-based features such as graphics or Java functions, disabling the Java Virtual Machine (JVM) during the compilation could improve the start up time about 20% to 30%:
mcc -m -R -nojvm test.m
It should be noted that once the MCR has been initialized and loaded your applications should run with a speed similar to the uncompiled application in MATLAB.
0 Comments
More Answers (0)
See Also
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!