strange behaviour of mpz_jacobi

Torbjorn Granlund tg at gmplib.org
Mon Nov 30 11:30:15 CET 2009


Paul Zimmermann <Paul.Zimmermann at loria.fr> writes:

  I have noticed the following strange behaviour of mpz_jacobi on a Core 2,
  with GMP 4.3.1:
  
  tarte% ./speed -s 507-517 mpz_jacobi
  overhead 0.000000002 secs, precision 10000 units of 3.53e-10 secs, CPU freq 2833.00 MHz
             mpz_jacobi
  507       0.008363055
  508       0.009152196
  509       0.010998000
  510       0.016997000
  511       0.007441896
  512       0.007531189
  513       0.007539446
  514       0.016997000
  515       0.010998000
  516       0.009297833
  517       0.008712443
  
Core 2, 2133 MHz, original design in 65 nm with slower division:
           mpz_jacobi
507       0.010864000
508       0.012250000
509       0.014721000
510       0.022101000
511       0.009850007
512       0.009956964
513       0.009983404
514       0.022406000
515       0.014865000
516       0.012358000
517       0.011457000

Core i7, 2667 MHz:
           mpz_jacobi
507       0.001457755
508       0.001457152
509       0.001466906
510       0.001470784
511       0.001363510
512       0.001375854
513       0.001405066
514       0.001496251
515       0.001496989
516       0.001518640
517       0.001519407

Athlon 64 X2, 2500 MHz, 65 nm:
           mpz_jacobi
507       0.010453000
508       0.010391000
509       0.010910000
510       0.010451000
511       0.010179000
512       0.010009000
513       0.010333000
514       0.010738000
515       0.010716000
516       0.012504000
517       0.010853000
  
So yes, I get fluctuations for Core 2.  The Core i7 and Athlon do not
have similar problems.  The Core i7 is much spectacularly faster than
the other chips for this function.

The Jacobi functions in GMP have been neglected for a long time.
Presumably, they could be tuned for modern software.

-- 
Torbjörn


More information about the gmp-devel mailing list