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: http://chezphil.org/tmp/boost_mp_review.tbz2

Just a couple of updates:

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

#ifdef USE_MP_INTN_NOET
  typedef int64_t i64;
  typedef boost::multiprecision::mp_number<
boost::multiprecision::cpp_int_backend<>, false> i128;
#endif

Should be:

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

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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk