help-octave
[Top][All Lists]
Advanced

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

Re: compare the executive speed with Matlab


From: Sergei Steshenko
Subject: Re: compare the executive speed with Matlab
Date: Fri, 2 Jan 2009 13:33:55 -0800 (PST)



--- On Fri, 1/2/09, John W. Eaton <address@hidden> wrote:

> From: John W. Eaton <address@hidden>
> Subject: Re: compare the executive speed with Matlab
> To: address@hidden
> Cc: "Jordi Guti��rrez Hermoso" <address@hidden>, address@hidden, "Howard" 
> <address@hidden>
> Date: Friday, January 2, 2009, 1:03 PM
> On  2-Jan-2009, Sergei Steshenko wrote:
> 

> Please, use cputime.  Wall clock time is meaningless here
> as there
> could be other things running on your system which affect
> the timing.
> 

> 
>   octave:1> angles = pi * (1:1000000) / 1000000;
>   octave:2> t = cputime (); sins = sin (angles); cputime
> () - t
>   ans =  0.072004

Here are better measurements - forgot to lock CPU frequency originally.

1) octave:

angles = pi * (1:1000000) / 1000000;tic;t = cputime (); sins = sin(angles); 
fprintf(stdout(), "CPU time: %g\n", cputime () - t);toc
CPU time: 0.140009
Elapsed time is 0.14142704010009765625 seconds.

2) "C":

CPU time took 0.04 seconds at line number 74 of 'benchmark_sin.c' file
Wallclock time took 0.0490916 seconds at line #74 of 'benchmark_sin.c' file

- the same 3+ times.

My 'octave' runs on a 32 bits machine. It uses

-mtune=native -march=native -mfpmath=sse,387 -O2

optimizations.

With this simple 'sin' test -mfpmath=sse,387 changes results:

CPU time took 0.06 seconds at line number 74 of 'benchmark_sin.c' file
Wallclock time took 0.047755 seconds at line #74 of 'benchmark_sin.c' file

- the funny thing is that now CPU time is less than wallclock time which
can't be.

If you count by CPU time, still the speedup is 2+ times for 

'octave' version is 3.0.3, it was built using the same gcc-4.3.2 I used
for benchmarking the "C" program.

--Sergei.


      



reply via email to

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