gdc or ldc for faster programs?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 25 21:26:50 UTC 2022


On Tue, Jan 25, 2022 at 08:04:04PM +0000, Adam D Ruppe via Digitalmars-d-learn wrote:
> On Tuesday, 25 January 2022 at 19:52:17 UTC, Ali Çehreli wrote:
> > ldc: ~0.95 seconds
> > gdc: ~0.79 seconds
> > dmd: ~1.77 seconds
> 
> Not surprising at all: gdc is excellent and underrated in the
> community.

The GCC optimizer is actually pretty darned good, comparable to LDC's. I
only prefer LDC because of easier cross-compilation and more up-to-date
language version (due to GDC being tied to GCC's release cycle). But I
wouldn't hesitate to use gdc if I didn't need to cross-compile or use
features from the latest language version.

DMD's optimizer is miles behind LDC/GDC, sad to say. About the only
thing that keeps me using dmd is its lightning-fast compilation times,
ideal for iterative development. For anything performance related, DMD
isn't even on my radar.


T

-- 
Doubtless it is a good thing to have an open mind, but a truly open mind should be open at both ends, like the food-pipe, with the capacity for excretion as well as absorption. -- Northrop Frye


More information about the Digitalmars-d-learn mailing list