Modern C++ Lamentations

H. S. Teoh hsteoh at
Sun Dec 30 13:46:46 UTC 2018

On Sun, Dec 30, 2018 at 01:25:33PM +0000, Guillaume Piolat via Digitalmars-d wrote:
> On Saturday, 29 December 2018 at 09:29:30 UTC, Walter Bright wrote:
> >
> It says:
> > C++ compilation times have been a source of pain in every
> > non-trivial-size codebase I’ve worked on. Don’t believe me? Try
> > building one of the widely available big codebases (any of:
> > Chromium, Clang/LLVM, UE4 etc will do). Among the things I really
> > want out of C++, “solve compile times” is probably #1 on the list,
> > and has been since forever.
> I agree, it has been #1 problem with C++ in years, and only getting
> worse.
> There is the theory (D builds fast) and the application (DUB often
> negate the advantage, you need to avoid templatitis).

D theory sounds all good and all, but in practice you have warts like
dub (one big reason I stay away from it -- though based on what Sonke
said recently, performance may have improved since I last checked),
std.regex (after the last big refactor, something Really Bad happened to
its compile times -- it didn't used to be this bad!), std.format (a big
hairball I haven't dared to look too deeply into), and a couple of
others, like various recursive templates elsewhere in Phobos. And also
std.uni's large templated internal tables, which may be (part of?) the
common cause of compile-time slowdowns in std.format and std.regex.

There's also dmd's ridiculous memory usage policy, which is supposed to
help compile times when you have ridiculous amounts of free RAM, but
which causes anything from swap thrashing slowdowns to outright
unusability on medium- to low-memory systems.


That's not a bug; that's a feature!

More information about the Digitalmars-d mailing list