Boost logo

Boost :

Subject: Re: [boost] [Multiprecision] Benchmarking
From: John Maddock (boost.regex_at_[hidden])
Date: 2012-06-15 13:59:32

> My test code is here:

Just a couple of updates:

1) Your test code doesn't actually test fixed-width integer types anywhere
as you have:

  typedef int64_t i64;
  typedef boost::multiprecision::mp_number<
boost::multiprecision::cpp_int_backend<>, false> i128;

Should be:

  typedef int64_t i64;
  typedef boost::multiprecision::mp_number<
boost::multiprecision::cpp_int_backend<128, true, void>, false> i128;

Of course the types are pretty similar, and it only saves a few percent -
relative times on Win32 were:

Your custom int128 1.9.
mp_int128 2.7.
cpp_int (no ET's) 3.2.

2) Some more comparisons with gmp shows expression templates help much more
in that case:

proposed mpz_int 100
proposed mpz_int (no ET's) 143
GMP's mpz_class [1] 140

Cheers, John.

1) With apologies to Marc Glisse I used the last released mpz_class, still
haven't looked at his improvements in GMP development :-(

Boost list run by bdawes at, gregod at, cpdaniel at, john at