How to stop DMD from exploding the executable file size?

H. S. Teoh hsteoh at qfbox.info
Thu Sep 1 22:31:50 UTC 2022


On Thu, Sep 01, 2022 at 10:15:03PM +0000, solidstate1991 via Digitalmars-d wrote:
> On Tuesday, 30 August 2022 at 22:58:44 UTC, ryuukk_ wrote:
> > ```
> > $ ldc2 -m64 app.d
> > $ ll
> > total 4545
> > -rw-r--r-- 1 ryuukk 197121      69 Aug 31 00:57 app.d
> > -rwxr-xr-x 1 ryuukk 197121  453120 Aug 31 00:57 app.exe*
> > -rw-r--r-- 1 ryuukk 197121 4195865 Aug 31 00:57 app.obj
> > ```
> > 
> > ```
> > $ dmd -m64 app.d
> > $ ll
> > total 8617
> > -rw-r--r-- 1 ryuukk 197121      69 Aug 31 00:57 app.d
> > -rwxr-xr-x 1 ryuukk 197121 4623872 Aug 31 00:57 app.exe*
> > -rw-r--r-- 1 ryuukk 197121 4196322 Aug 31 00:57 app.obj
> > ```
> 
> LDC has way better optimization features, so it's kinda expected.

Yep.  LDC is my go-to compiler for release builds.  I use dmd for
development because the turnaround time is faster, but I also don't care
about performance/executable size when using dmd.  For release builds
when I *do* care about those things, I use LDC; dmd isn't even on my
radar for that.


T

-- 
Amateurs built the Ark; professionals built the Titanic.


More information about the Digitalmars-d mailing list