Modern C++ Lamentations

H. S. Teoh hsteoh at
Sun Dec 30 14:27:56 UTC 2018

On Sun, Dec 30, 2018 at 01:58:56PM +0000, Nicholas Wilson via Digitalmars-d wrote:
> On Sunday, 30 December 2018 at 13:46:46 UTC, H. S. Teoh wrote:
> > 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.
> Rainer an Martin Kinkelin have been working on that for LDC, they
> might upstream eventually.

Recently I noticed that LDC now compiles every function into their own
section and runs LTO, including GC of unreferenced sections, by default.
As a result, executable sizes are back down to where equivalent C/C++
code would be, as opposed to being a MB or so larger when compiled with
DMD. It more-or-less nullifies most of the ill-effects of template

Furthermore, LDC now tracks dmd releases very closely, almost on par,
produces better code, has a far wider range of target archs, like
Android/ARM, that I doubt DMD will ever support in the foreseeable
future, and recently shows compile times pretty close to DMD (with
things like std.regex or std.format making DMD dog-slow anyway, the
extra time the LDC backend takes for codegen basically becomes roundoff

Right now, I'm very tempted to drop dmd as my primary D compiler and use
LDC instead. If this memory usage thing is fixed in LDC, I probably WILL
drop dmd for good and use LDC instead.  I've been itching to get D to
compile on some of my low-memory systems but have been hampered until
now -- it's been extremely frustrating.


"You are a very disagreeable person." "NO."

More information about the Digitalmars-d mailing list