Generated binary size

Dicebot public at dicebot.lv
Fri Sep 13 04:45:58 PDT 2013


I was experimenting with `--gc-sections` effect on D code (with 
great results) and have noticed that GDC binaries are much bigger 
than DMD ones. I do understand that it is not a priority goal 
right now but still curious, does anyone know what makes such 
notable (~50%) difference?
(64-bit OS)

--------
import std.stdio, std.algorithm;

void main()
{
     auto arr = [ 1, 2, 3 ];
     writeln( arr.map!( a => a*2 )() );
}
--------
$ gdc -ofhello-gdc -O3 hello.d
$ dmd -ofhello-dmd -release -inline -O hello.d
$ ls -la
# ...
-rwxr-xr-x 1 dicebot users  819647 Sep 13 13:38 hello-dmd
-rwxr-xr-x 1 dicebot users 1386355 Sep 13 13:39 hello-gdc
-------


More information about the D.gnu mailing list