[clean-list] Matrix timings

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Tue, 30 Oct 2001 09:13:01 +0100


Shivkumar Chandrasekaran shiv@ece.ucsb.edu schrieb,

> This timing is way too slow. On my PowerBook G4 (400Mhz) (running Mac OS 
> X), Scilab took 0.31 seconds to solve a system with 300 equations and 
> 300 unknowns. Allowing for a processor that is 4 times slower we would 
> "expect" to solve it in 1.21 seconds on a 100MHz processor. Scilab (on 
> my machine) uses ATLAS BLAS. If we disallow for tuned BLAS 
> (conservatively) we can expect the 100MHz processor to be 16 times 
> slower, yielding an expected running time of 0.31 * 16 = 4.96 seconds.

[Only to be sure:

A X = Y

A is a 300x300 array and Y and the solution array X is also a 300x300
array]

Sorry, but you should at least see a difference between a factor of
10-20 to your G4 400MHz and my 100MHZ 603e, and not a factor of 4. And
then you should also take into account the memory and caching. The world
is not that easy to see here a linear scale. The Performa 5300 is not
only a crap it is also only designed for integer values (603e
processor):

A citation from comp.lang.functional (discussion about Lisp's
performance and my processor):

..."No, the reason as I said is the weakness of the MCL compiler.
It is true that for example the PowerPC 603e processor is lame.
Generally I'd expect a 600Mhz G3 to be about twenty times faster
executing MCL code - compared to a 100Mhz 603e. The 603e
combines a slow architecture with low clock rates."...

*Do you have any values for my Clean code on your machine? I would be
really interested in?* PLEASE post it!

As I posted before Matlab has got the same timings as Yorick on my
Macintosh. So, I would assume Scilab is not actually faster as Matlab or
Yorick (I once installed Scilab for the classic MacOS; but it was 10 to
100 times slower than Yorick or Matlab; okay the calssic MacOS has been
not very actively supported by Inria). 

> In my own timings I found that Clean is typically 2.5 to 5 times (not 
> 1.5 times) slower than equivalent code compiled with gcc. The best 
> performance (2.5 times slower than C) was obtained when I simulated 2D 
> arrays with 1D arrays.

No, 1.3 is a good value. I implemented on my Macintosh the FFT in Clean
and the same code in C (native Apple compiler C/C++). Then, there is
only a factor of 1.3 difference in execution speed!

On arrays you may not forget that they are stored rows after rows. When
you want access columns after columns it is often better to transpose
the array before handling. But as long as you do not post the above
code, which is way slower than the C version I only have to speculate.

But there is a nice paper:

http://www.cs.kun.nl/~clean/Research/publications/publications.html

and therein look (at 1997) for:

2.Groningen, John H.G. van (1997), The  Implementation and Efficiency of
Arrays in Clean 1.1 ,



Please again, post the figures of your execution time on your Mac. I
would be really interested in, because I do not have access to another
Macintosh. Downloading the MersenneTwister is really straightforward and
coping and pasting my code is it too.

S. Gonzi