compare the executive speed with Matlab

Sergei Steshenko sergstesh at yahoo.com
Fri Jan 2 14:45:38 CST 2009




--- On Fri, 1/2/09, Jordi Gutiérrez Hermoso <jordigh at gmail.com> wrote:

> From: Jordi Gutiérrez Hermoso <jordigh at gmail.com>
> Subject: Re: compare the executive speed with Matlab
> To: sergstesh at yahoo.com
> Cc: "John W. Eaton" <jwe at octave.org>, help at octave.org, "Howard" <shj1130 at pchome.com.tw>
> Date: Friday, January 2, 2009, 12:21 PM
> 2009/1/2 Sergei Steshenko <sergstesh at yahoo.com>:
> > My experiment was more severe.
> 
> Show us the experiment, then.
> 
> > In both cases I had prepared array (vector in
> 'octave') of 'sin' function
> > arguments, and I wasn't benchmarking the
> preparation part, I was
> > benchmarking just the 'sin' computation part.
> 
> That's what I timed too.
> 
> > Your experiment is not fair in its "C" part
> since it has int -> double
> > conversion while 'octave' part doesn't
> have it.
> 
> Actually, I thought that Octave had this conversion too. At
> any rate,
> it doesn't affect the execution speed at all to use
> double i instead;
> I just tried it too.
> 
> > I was also measuring time _inside_ the "C"
> program - to avoid whatever
> > startup time artifacts.
> 
> I can't think of any artifacts that could have taken
> place here. There
> is no construction, memory management, whatever. Nothing of
> the sort.
> 
> Just show us the fucking code. And I mean this in a good,
> non-confrontational way, and I hope you'll pardon my
> intensifier. :-)
> 
> - Jordi G. H.


Sure, sure.

1) 'octave':

octave:36> angles = pi * (1:1000000) / 1000000;tic; sins = sin(angles); toc
Elapsed time is 0.49532795 seconds.

2) "C":

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


; the file is attached ('benchmark_sin.c'), it contains the command line
I used to compile it.

OK, so it's not 5 times, it's more than 3 times.

I think, however, that if I use table representation of 'sin', the ratio
will be the 5 times I vaguely remember.

Regards,
  Sergei.


      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmark_sin.c
Type: text/x-c++src
Size: 1926 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090102/fe1d48b2/attachment-0001.bin 


More information about the Help-octave mailing list