octave-maintainers
[Top][All Lists]

## Re: Slowup in 2.1.54

 From: David Bateman Subject: Re: Slowup in 2.1.54 Date: Tue, 17 Feb 2004 22:45:42 +0100 User-agent: Mutt/1.4.1i

```According to Dmitri A. Sergatskov <address@hidden> (on 02/17/04):
>
> I also noticed that recursion is slower. For sciview tests it is in
> grand common divisors tests (gcd2.m).
>
> 2.1.50:
<snip>
> Grand common divisors of 70,000 pairs (recursion)___ (sec): 0.447
<snip>
> Escoufier's method on a 37x37 matrix (mixed)________ (sec): 3.515
>
> 2.1.54:
<snip>
> Grand common divisors of 70,000 pairs (recursion)___ (sec): 0.5951
<snip>
> Escoufier's method on a 37x37 matrix (mixed)________ (sec): 4.484

The gcd stuff might just be a timing error. The code used for the timing
in the sciview tests is pretty rough, using tic/toc. I've replaced this
in my version using cputime instead. and get the follow

2.1.50:
Grand common divisors of 70,000 pairs (recursion)___ (sec): 0.6133
Escoufier's method on a 37x37 matrix (mixed)________ (sec): 2.96

2.1.54:
Grand common divisors of 70,000 pairs (recursion)___ (sec): 0.6033
Escoufier's method on a 37x37 matrix (mixed)________ (sec): 5.09

So the only significant slow up I see is in the last test. Here is another
interting set of tests

2.1.50
tic; x = []; for i=1:1e3; x = [x, i]; endfor; toc
ans = 0.079843
tic; x=0; for i=1:1e3; x++; endfor; toc
ans = 0.018920

2.1.54
tic; x = []; for i=1:1e3; x = [x, i]; endfor; toc
ans = 0.87523
tic; x=0; for i=1:1e3; x++; endfor; toc
ans = 0.014731

Which shows that that the loops are roughly the same speed in 2.1.50
and 2.1.54 and maybe even slightly faster in 2.1.54. However the
concatenation is at about 10 times slower !!! This is exactly the same
type of code that is used in the last of the sciview tests. So this is
bad. Looks like Nd concatenation support needs some optimizing.

Regards
David

--
Motorola CRM                                 +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: