Boost logo

Boost :

Subject: Re: [boost] [testing] Add a tester with hidden visibility
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-05-07 13:55:51

On 7 May 2015 at 18:38, John Maddock wrote:

> > Since C++ 11 we have extern templates, and that finally makes
> > dllexporting template instantiations useful. I can see very
> > significant potential benefits especially to compile and link times
> > there,
> Boost.Regex has done this since day 1 for compilers that support it
> (msvc and gcc). Compile time speedups are larger on msvc, but in both
> cases well worth the effort. In fact it's one reason the library hasn't
> gone header-only: it could probably be done, but compile times are just
> *so* much faster when the template instances are in an external lib...

Good stuff.

For reference, AFIO a very simple library sees this with precompiled
headers enabled:

GCC: 12m => 10m
MSVC: 7m => 2m
clang: No change

AFIO also has the ability to both use precompiled headers and not be
header only:

GCC: 4m
MSVC: 1m

So especially big wins for GCC.

I suspect that C++ Modules cannot deliver any improvements over the
non-header only with precompiled headers configuration. Good build
config always beats compiler magic.


ned Productions Limited Consulting

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