On Tue, 22 Dec 2009, Berend Hasselman wrote:
On 22-12-2009, at 15:50, Sven Schreiber wrote:
> Hi,
> yet another useless benchmarking exercise: ...
Not useless at all, in fact it's extremely interesting. Thanks, Sven.
I have the feeling (and valgrind+callgrind seems to give supporting
evidence) that gretl spends most of its time generating random numbers.
The actual matrix operations take very little in comparison. Allin and I
have been aware that random number generation still has margins for
optimisation, only we haven't had time to pursue the matter.
By the way, the algorithm we use for generating normals is polar
Box-Müller (and before you all jump on me on this one: yes, I am aware of
all the criticism on Box-Müller, but the fact that we are using the
Mersenne Twister for uniforms instead of a plain congruential generator
makes the point sort of moot). We may want to switch to Marsaglia's
ziggurat method, which is said to be very fast and accurate. I don't know
first-hand, as I never implemented it myself, but there seems to be a
certain degree on unanimity on this by experts (beside, it was invented by
George Marsaglia, who is the highest authority on RNG in this solar
system).
Sven, could you try to tune your script to compute the timings of random
number generation and matrix operations separately?
Oh, and one last thing: I'll be on holiday from tomorrow, so don't expect
me to do anything on this or other stuff soon. That said, happy Christmas
to everyone!
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti