Bill Allombert on Tue, 20 May 2003 19:05:19 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Sparse matrix multiplication // charpoly


On Tue, May 20, 2003 at 11:21:26AM -0500, Gonzalo Tornaria wrote:
> 0'') The PARI multiplication seems "to learn" (!), in fact, the first
> time one multiplies takes longer. E.g. for 500x500 my data shows that
> SPARSE*SPARSE takes more time than DENSE*SPARSE, but that seems to be
> because I use the same matrix, 10 times for each, but the first time it
> takes twice as much (!) So, put more salt on my numbers :-)

This is an artefact due to the processor cache: the first multiplication
move the matrix in the cache, which save lot of time in the subsequent
multiplication. 

When you "study" a matrix, you also copy it to the cache, but 
also reduce memeory usage so the subsequent multiplication is faster.

Cheers,
Bill.