Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

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

From: Hermano Cappa

Date: 25 Feb, 2011 15:55:08

Message: 1 of 6

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!

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

From: Bruno Luong

Date: 25 Feb, 2011 19:29:07

Message: 2 of 6

"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

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

From: Matt J

Date: 25 Feb, 2011 20:36:19

Message: 3 of 6

"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.

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

From: Bruno Luong

Date: 26 Feb, 2011 09:09:05

Message: 4 of 6

"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

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

From: Matt J

Date: 26 Feb, 2011 13:11:20

Message: 5 of 6

"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...

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

From: HB

Date: 26 Feb, 2011 17:21:15

Message: 6 of 6

On Feb 25, 4:55 pm, "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 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!

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.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us