[clean-list] Re: 9. Re: Matrix timings
Wed, 07 Nov 2001 15:21:44 +0100
> From: Shivkumar Chandrasekaran <email@example.com>
> Is there some documentation somewhere which describes what kind of
> "loops" involving unique arrays will be "optimized" by the Clean
> The reason I ask is that it seems pretty difficult to predict how the
> Clean compiler will behave. For example, sometimes 2D arrays
> comprehensions seem to be reasonably efficient, and sometimes not.
This is true. Maybe you can remember the post where I compared Clean to Yorick in solving a linear-system on my old Mac. Yorick has been 30% faster.
Today I tried it on a Pentium III with 450MHz and to my surprise Yorick actually is 3 times faster. I could not figure it out why, because Yorick is only Unix native and the Windows and Macintosh versions are only "second
E.g. solving a random 500x500 array for another 500x500 takes with Yorick 2.5sec but Clean takes 7sec. A time profiling shows that most of the time is spent in "dot_sum" (in the backward and forward substitution). For a
300x300 and 300x300 array Yorick takes 0.7sec on a Pentium III 450MHz and Clean takes 2sec! I am not sure whether there exists a faster method for the backward and forward substitution.
It is strange, because the FFT for a 1024x1024 array takes with Yorick and Clean the same time (Yorick solves the FFT via the Schwarztrauber algorithm; I use a code similar to the Numerical recipes one). On my Mac Yorick is
20 to 30% faster at the FFT.
But why this isn't transferable to the Gauss-algorithm is a mystery.
> when we row-scan a 2D array does the compiler prefer that we explicitly
> bind a variable to the row we are scanning?
I think posting code here or describing the problem more in detail would be a good idea.