Stand-Alone Compiled vs. MatLab Code Runtimes

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by B. Andre W » Thu, 09 Nov 2006 07:25:07


A colleague and I have just started using stand-alone compiled
m-files on client computers with MatLab Compiler Runtime (MCR). We've
noticed that there is a significant delay (about a minute) in
launching the compiled m-file compared to when running it directly on
MatLab (virtually no time at all). By placing msgbox's and tic/toc's
within the code, once launched, it seems to do fine.

This seems to exist across OS plaforms (Windows, Linux, don't know
about Mac yet). The codes We have compiled vary in size and functions
and toolboxes used. Any suggestions on what to examine first in order
to speed things up for our clients?
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by Dan Hensle » Thu, 09 Nov 2006 09:19:59


It shouldn't be any surprise. The MCR "compiled" version basically
launches the equivalent of Matlab every time you run the executable. Once
that environment is loaded, it runs your m-files (embedded in the CTF) the
same as from Matlab.


I'm not sure there's anything you can do about it. Others may have a
better answer.

Dan

 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by Herbert Ra » Thu, 09 Nov 2006 15:56:04


Dan has already explained the reasons for the slow execution. Depending
on your needs you can deactivate Java support in the compiled code (mcc
... -R -nojvm ...) which significantly decreases the startup time.

-Herbert
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by B. Andre W » Fri, 10 Nov 2006 23:01:36

Herbert and Dan,

Thanks for the suggestion and input,

We tried running without the Java portion of the compiler as
suggested and didn't see any improvement for our particular macros.

Based on what you are saying it makes sense that once the MCR is
running in the foreground, re-executing any macro is very quick. This
is what we see.

Not ideal, but our clients will live.

- Andre
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by Paul Menne » Sat, 11 Nov 2006 08:41:28

>> Any suggestions on what to examine first in


Sure ... revert to the compiler they shipped with Matlab 6.5.

The .exe applications start almost before you
finish clicking on them! The footprint is very
small as well (about 5 Mbytes after I used
< http://www.yqcomputer.com/ > to compress the larger DLLs).
Even small enough to email. (Compare that to the
100 Mbyte Matlab 7 MCR.) Perhaps there is some
additional functionality, but is it worth it?

I don't know why TMW abandoned the old compiler.
It works great even with my most complex
GUI applications. I'll probably be using that same
compiler 15 years from now.

~Paul
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by J. Lui » Sat, 11 Nov 2006 10:00:01


I agree 100% and also ask why was the compiler abandoned?
The new thing is another thing. Not a compiler.

Note: those 100 Mb are when compressed. Expanded, they take about
350.

J. Luis
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by Dan Hensle » Sat, 11 Nov 2006 15:41:50

>

For starters, the old compiler couldn't compile objects, or anything
Java-based (i.e. timer object). That's a big deal for lots of people (me
included). That being said, the massive footprint of the MCR is also very
painful. So I use the 6.5 compiler for some things, and the new compiler
for others.

Dan
 
 
 

Stand-Alone Compiled vs. MatLab Code Runtimes

Post by someon » Sun, 12 Nov 2006 06:43:37

>So I use the 6.5 compiler for some things, and the new
For me is even worse: I develop for 6.5 and 7, and compile and deploy
with the 6.0 compiler (which is even faster than the 6.5, at least
for my application)!
Regards
John