help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave vs. matlab speed


From: Alexander Barth
Subject: Re: octave vs. matlab speed
Date: Thu, 10 Aug 2006 12:30:21 -0400
User-agent: Thunderbird 1.5.0.2 (X11/20060501)

Hi Robert,
I did a simple benchmark on a AMD 64 Opteron (2GB memory) implying a loop and 
matrix multiplication:

% simple_benchmark.m
tic
n = 200;
A = rand(n,n);
for i=1:1000
  A = A + rand(n,n) * rand(n,n);
end
toc

The execution speed it quite sensitive to the BLAS and LAPACK libraries. It is 
well known that the
ATLAS versions of those libraries give a significant improvement in speed.

# Standard BLAS and LAPACK
$ octave -q simple_benchmark.m
Elapsed time is 32.579529 seconds.

# ATLAS tuned BLAS and LAPACK from Fedora Core 5 repositories
$ octave -q simple_benchmark.m
Elapsed time is 11.278023 seconds.

# ATLAS tuned BLAS and LAPACK recompiled on my platform
$ octave -q simple_benchmark.m
Elapsed time is 11.252762 seconds.

# matlab 2006a (which includes ATLAS)
>> simple_benchmark
Elapsed time is 9.796227 seconds.

The bottom line is that ATLAS gives a significant speed improvement over 
standard LAPACK and BLAS
libraries. However, recompiling ATLAS to enable additional optimization may not 
be worth the
trouble. For this simple example the speed of octave with ATLAS is actually 
quite close to the speed
of matlab. Larger differences are to be expected for more complex codes.

So you might want to check if octave uses ATLAS or not.

Cheers

Alex

Some additional infos about my system:
Fedora Core 5
octave-2.9.7-1.fc5
atlas-3.6.0-10.fc5
blas-3.0-37.fc5
lapack-3.0-37.fc5
gcc (GCC) 4.1.1 20060525





Robert Uang wrote:
> Hi,
> 
> I have just discovered octave recently and I am
> thrilled about it mainly for two reasons - 1. it is
> similar to Matlab code, and 2. it is absolutely free!
> 
> However, running the same procedure in Matlab is 100x
> faster than running in Octave.  Can you comment on why
> this is so, and if there are any general rules of
> thumb to help speed up simulation time?
> 
> Thanks,
> 
> Robert
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]