Boost logo

Boost :

Subject: Re: [boost] [multiprecision]: 15% slowdown using -std=c++11 compiler flag
From: John Maddock (jz.maddock_at_[hidden])
Date: 2017-11-19 13:54:09

On 19/11/2017 10:32, Kim Walisch via Boost wrote:
> I have been investigating a 15% performance regression in my C++
> primesum program (
> over the last 2 days.
> By lots of benchmarking I was able to identify the boost
> multiprecision library together with -std=c++11 (or -std=gnu++11)
> as the culprit for the performance regression because I have also
> a version of the primesum program which does not use the boost
> multiprecision library and in this version there is no performance
> regression when compiling using -std=c++11.
> I have tested using multiple versions of the boost multiprecision
> library including the latest 1.65.1. The slowdown happens on
> both GCC (versions: 5.4, 6.4, 7.2) and Clang (version 3.8) on
> x86_64 Linux. I am only using the int256_t and uint256_t types
> (hence cpp_int backend) and I am doing only simple integer
> arithmetic: +, - and *.
> Is this a known issue and is there a known workaround e.g. special
> compiler flag? I could revert to C++98 but I really don't want to do
> that...

No, not known, and if anything C++11 should speed things up by enabling
rvalue-references etc.  If you can narrow it down some more I'll
certainly investigate.

Thanks for the heads up, John.

This email has been checked for viruses by AVG.

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