Bill Allombert on Sat, 17 Jan 2004 16:35:21 +0100


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

Re: Flx_sqr/sqri comparaison


On Sun, Jan 11, 2004 at 07:20:30PM +0100, Bill Allombert wrote:
> I am still puzzled by straight Flx_sqr being so slow.

Karim told me the threshold between basecase and Karatsuba
multiplication were not tuned.

I fixed that, now we get:

i       : old  : new    | int : GMP
1       : 40   : 30     | 30  : 30
2       : 20   : 20     | 20  : 10
3       : 20   : 10     | 10  : 10
4       : 30   : 20     | 10  : 0
5       : 40   : 10     | 10  : 10
6       : 60   : 30     | 10  : 20
7       : 90   : 40     | 20  : 20
8       : 140  : 60     | 40  : 30
9       : 210  : 90     | 60  : 40
10      : 320  : 130    | 90  : 60
11      : 490  : 200    | 140 : 90
12      : 730  : 320    | 200 : 110
13      : 1120 : 480    | 320 : 130
14      : 1670 : 730    | 490 : 150
15      : 2550 : 1110   | 750 : 180
16      : 3800 : 1670   | 1140: 210

Flx_sqr is now more that 2 time slower, though still slower than
integer multplications.

Now, I suppose I will commit my patch for reusing sqri when the prime
is small enough.

Cheers,
Bill.