Another performance question

Kevin Ryde user42 at zip.com.au
Wed May 5 23:19:01 CEST 2004


Michel Bardiaux <mbardiaux at peaktime.be> writes:
>
> Well, I tried that route, and my smalles common denominators overwhelmed
> 32-bits almost at once, and 64-bits after a few days of develeopment
> work, which is why I went to GMP.

Well, if the numbers are genuinely big, or bigger than a fixnum might
be, then an alternative is to keep a free-list of initialized mpz_t's,
ready for use and re-use, as suggested in the manual.

demos/perl/GMP.xs does that, buried in the CREATE_MPX macro (shared by
mpz and mpq).  I'm not sure of the performance impact, it might not be
much in the context of perl.  But on systems with slow malloc/free it
should certainly help.


More information about the gmp-discuss mailing list