Are you wondering why vectorized calcs in Matlab are faster than non-vectorized calculations in Matlab?  Or are you wondering why vectorized calculations in Matlab are faster that the same calculations in VXL?

 

 

From: Friedmann Y. [mailto:Y.Friedmann@swansea.ac.uk]
Sent: Wednesday, May 16, 2012 9:55 AM
To: Ian Scott
Cc: Vxl-Users
Subject: Re: [Vxl-users] vectorise image

 

so how is it that the vectorised calcs are so much faster in matlab?


-----Original Message-----
From: Ian Scott [mailto:scottim@imorphics.com]
Sent: Wed 16/05/2012 14:15
To: Friedmann Y.
Cc: Vxl-Users
Subject: Re: [Vxl-users] vectorise image



On 16/05/2012 13:49, Friedmann Y. wrote:
>
> So is it right to assume that when using vectors in MATLAB to do the
> same calculations, their 10 times higher efficiency is due to compiler
> optimization?
>
> Yasmin

It is long time since I used matlab proper, but at that time it was a
not a compiled language. Octave, the GPL matlab-clone behaves that way
now. Everything was looked up on demand.  Not just indexing, but even
variable name dereferencing. Loop content was evaluated (and possibly
even parsed) afresh every iteration. No compilation - therefore no
opportunity for any optimisation.


Ian.