Jacobi/Legendre/Kronecker

Torbjorn Granlund tg at gmplib.org
Tue Dec 18 17:47:24 CET 2012


nisse at lysator.liu.se (Niels Möller) writes:

  Zimmermann Paul <Paul.Zimmermann at loria.fr> writes:
  
  > I'm glad you asked (on the AMD processor):
  >
  > frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a
  > frite% ./a.out
  > GMP: header 5.0.5, library 5.0.5
  > mpz_jacobi:       408ms
  > mpz_legendre:     412ms
  > mpz_kronecker_ui: 240ms
  > mpz_ui_kronecker: 508ms
  >
  > frite% gcc -I/tmp/include -O2 -g e.c /tmp/lib/libgmp.a
  > frite% ./a.out
  > GMP: header 5.1.0, library 5.1.0
  > mpz_jacobi:       536ms
  > mpz_legendre:     536ms
  > mpz_kronecker_ui: 256ms
  > mpz_ui_kronecker: 500ms
  >
  > Apparently we have a noticeable regression...
  
  I don't have the time to investigate carefully right now, but some
  comments:
  
I don't think we can draw significant conclusions about Paul's timing
program as currently written.  I tried removing the mpz_jacobi call from
the 1st function, and it made very little difference.  Clearly most of
the time is spent in malloc and free.

Perhaps there is slowdown from 5.0 to 5.1 anyway.  Perhaps it is worse,
if the memory overhead is subtracted.

But I don't think we should block the release for this.  Even if the
slowdown turns out to be significant, we can fix it later.  These tests
exercise operands of up to something like 20 bits, which is not really
GMP's home turf.

-- 
Torbjörn


More information about the gmp-devel mailing list