From: Paul K. <pv...@pv...> - 2013-04-24 18:23:04
|
Akshay Srinivasan wrote: > I was looking into the code, and it looked like GMP(through the FFI) was > slower than SBCL's > bignums (for bignum length's of ~50000) (for mpz-mul, mpz-add). I know that > the FFI overhead costs > quite a lot if one is calling foreign functions for small arguments; and > presumably GMP beats > SBCL for larger numbers. > ------------------------------------------------------------------------------------------------------------- > GMP-BIGNUM> > (progn > > (time (progn (* *a* *b*) > t)) > > (time (mpz-mul *a* > *b*)) > > > t) > > Evaluation > took: > > 0.000 seconds of real > time > > 0.000000 seconds of total run time (0.000000 user, 0.000000 > system) > > 100.00% > CPU > > 1,334 processor > cycles Didn't you find 1.3k cycles to multiply bignums of ~.5 MB a bit too quick? The compiler elided that multiplication as dead code. Paul Khuong |