On 4/26/2013 7:04 PM, Loki wrote: > > Vecorized code is tremedously faster when compared to non-vectorized > code. > > Why is so? Reason lies only in CPU vector instructions that matlab > uses internally when execute vetorized code, or there are other > reasons? > > To find more informations via google is strangely difficult. >
"Performance: Vectorized code often runs much faster than the corresponding code containing loops."
as to WHY vectorized code is faster, well, I think only person who can answer this for sure, is someone working inside Matlab, in the run-time/compiler group.
But simply googling "matlab why is vectorized faster" I see many well reasoned answers there all over the web on this. I only see sites showing that vectorized code is not always faster the loops. I seem to remember that few years ago MW did improvement to their jit compiler to improve loop speeds, so the difference is not that much. I would guess it depend on the code being processed each time.