f



Is the matlab compiler faster than just running your code in Matlab?

Hi,

I made a very complicated orbit model for calculating the error motion of a spindle. If run my program it takes several days to end the calculation. I optimized my code using the profiler. However, my calculation still takes some days....

If I use the Matlab compiler (.exe) for my calculations, will this save a lot of calculation time compared with running my program just in Matlab?

Any suggestion is welcome!
0
Hermano
2/25/2011 3:55:08 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

5 Replies
1327 Views

Similar Articles

[PageSpeed] 21

"Hermano Cappa" wrote in message <ik8jcs$dnh$1@fred.mathworks.com>...

> If I use the Matlab compiler (.exe) for my calculations, will this save a lot of calculation time compared with running my program just in Matlab?

Possibly not.

Bruno
0
Bruno
2/25/2011 7:29:07 PM
"Hermano Cappa" wrote in message <ik8jcs$dnh$1@fred.mathworks.com>...
>
> If I use the Matlab compiler (.exe) for my calculations, will this save a lot of calculation time compared with running my program just in Matlab?
======

Mathworks claims that the speeds should be about the same. I've seen cases, however, where the .exe is distinctly slower than the original M-code.
0
Matt
2/25/2011 8:36:19 PM
"Matt J" wrote in message <ik93s3$cie$1@fred.mathworks.com>...
> 
> Mathworks claims that the speeds should be about the same. I've seen cases, however, where the .exe is distinctly slower than the original M-code.

Can you provide a short code to illustrate?

Bruno
0
Bruno
2/26/2011 9:09:05 AM
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ikafvh$cji$1@fred.mathworks.com>...
> "Matt J" wrote in message <ik93s3$cie$1@fred.mathworks.com>...
> > 
> > Mathworks claims that the speeds should be about the same. I've seen cases, however, where the .exe is distinctly slower than the original M-code.
> 
> Can you provide a short code to illustrate?
=============

No, the example where I observed this was a long was a long piece of code, and a proprietary one, so I guess you'll have to take this with a grain of salt.

I believe it had to do with a call to uigetfile(), and to test it, you might just try to compile a simple 1-line uigetfile command. The first run of the .exe will definitely be very slow, undoubtedly because it has to  load certain GUI libraries for the first time, but I believe on subsequent runs it could still be a bit slow...
0
Matt
2/26/2011 1:11:20 PM
On Feb 25, 4:55=A0pm, "Hermano Cappa" <cappaste...@gmail.com> wrote:
> Hi,
>
> I made a very complicated orbit model for calculating the error motion of=
 a spindle. If run my program it takes several days to end the calculation.=
 I optimized my code using the profiler. However, my calculation still take=
s some days....
>
> If I use the Matlab compiler (.exe) for my calculations, will this save a=
 lot of calculation time compared with running my program just in Matlab?
>
> Any suggestion is welcome!

I'm not sure how this differs depending on what the program does, but
I had a similar problem once. I spent 2 or 3 days writing some c-code
(and compile it in Matlab), only to find out that it's slower than
Matlab code. But it might still be worth a shot in your case.
0
HB
2/26/2011 5:21:15 PM
Reply: