[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: profiler and/or debugger, loops vs vectorization
From: |
John W. Eaton |
Subject: |
Re: profiler and/or debugger, loops vs vectorization |
Date: |
Wed, 5 Jul 2006 12:13:12 -0400 |
On 5-Jul-2006, David Grohmann wrote:
| Octave was on a linux machine, matlab was on a windows machine.
|
| However it seems that vectorizing the code makes up the difference. I
| didn't know that such a performance boost would happen with vectorization.
Looping is slow in Octave. Looping used to be slow in Matlab, but
recent versions have a just-in-time compiler that makes looping much
faster, so now people are starting to write old-time-fortran-style
loops in Matlab to do things that can be neatly expressed in
matrix-vector operations (this is progress?). OK, sometimes writing
matrix-vector operations obscures what is happening, but many times it
is much cleaner to write matrix-vector code. I'd bet there are even
some people out there who are now writing things like
xsum = 0.
for i = 1:n
xsum = xsum + x(i);
end
instead of just writing using the sum function.
In any case, comparing Octave vs. Matlab on a for loop is not really a
fair comparison. If you are wondering when Octave will have the same
kind of JIT capability, then the answer is when someone contributes
the code to do it, or provides sufficient funding to make it happen.
jwe
- Re: profiler and/or debugger, loops vs vectorization, John W. Eaton, 2006/07/01
- Re: profiler and/or debugger, loops vs vectorization, David Bateman, 2006/07/01
- Re: profiler and/or debugger, loops vs vectorization, David Grohmann, 2006/07/05
- Re: profiler and/or debugger, loops vs vectorization, David Bateman, 2006/07/05
- Re: profiler and/or debugger, loops vs vectorization,
John W. Eaton <=
- Re: profiler and/or debugger, loops vs vectorization, Andy Adler, 2006/07/05
- Re: profiler and/or debugger, loops vs vectorization, David Grohmann, 2006/07/05
- Message not available
- Re: profiler and/or debugger, loops vs vectorization, Jordi Gutierrez Hermoso, 2006/07/05
- Re: loops vs vectorization, Robert A.Macy, 2006/07/05
- Re: loops vs vectorization, Rafael Almeida, 2006/07/05
- Re: loops vs vectorization, Robert A.Macy, 2006/07/05
- Re: loops vs vectorization, Ozzy Lash, 2006/07/05
- Re: loops vs vectorization, Robert A.Macy, 2006/07/05
- Re: loops vs vectorization, Ozzy Lash, 2006/07/06
- Re: loops vs vectorization, Joan Picanyol i Puig, 2006/07/06