When compiling GtkD <https://github.com/gtkd-developers/GtkD> with dmd 2.063.2, the resulting static libraries size increases a lot.
GtkD-2 (HEAD) built with dmd 2.062 (64-bit):
libgstreamerd-2.a (3,3M)
libgtkd-2.a (35M)
libgtkdgda-2.a (1021K)
libgtkdgl-2.a (492K)
libgtkdsv-2.a (1,3M)
GtkD-2 (HEAD) built with dmd 2.063.2 (64-bit):
libgstreamerd-2.a (14M)
libgtkd-2.a (138M)
libgtkdgda-2.a (4,9M)
libgtkdgl-2.a (3,0M)
libgtkdsv-2.a (5,8M)
Comment #1 by g.sayol — 2013-06-21T23:20:32Z
Same on dcollections <http://www.dsource.org/projects/dcollections>
dcollections r117 built with dmd 2.062 (64-bit):
libdcollections.a (123K)
dcollections r117 built with dmd 2.063.2 (64-bit):
libdcollections.a (2,0M)
Comment #2 by mike — 2013-06-22T07:19:54Z
It looks like this is being caused by a change/bug? in phobos/druntime.
Comment #3 by g.sayol — 2013-06-23T00:51:06Z
It seems that the problem comes from the object file generation.
i.e. at GtkD project, the file "src/cairo/Types.d" <https://github.com/gtkd-developers/GtkD/blob/master/src/cairo/Types.d>
$ dmd -c -O -m64 -Isrc src/cairo/Types.d
Built with dmd 2.062 (64-bit):
Types.o (4.6K)
Built with dmd 2.063.2 (64-bit):
Types.o (149K)
Comment #4 by mike — 2013-06-23T05:38:57Z
I was using git bisect with dmd, but couldn't find the commit that introduced the bug. As it turns out i was running the tests with the phobos lib from 2.063.
And building gtkD with dmd 2.063 in combination with the phobos libs and sources from 2.062 the size of the GtkD lib is back to ~35M.
Comment #5 by mike — 2013-06-23T07:48:47Z
The first Phobos commit that causes the huge library size is:
https://github.com/D-Programming-Language/phobos/commit/337f268cf1e24a25728eea417c4a76a907eec21e
Before that change the GtkD lib size is ~35M and after it's ~144M.
Only checking out the latest Phobos HEAD and reverting 337f268cf1e24a25728eea417c4a76a907eec21e the GtkD lib is still ~125M so there are other commits that have an similar affect.
This is just a wild guess, but could it be caused by the use of std.format in the unittests? I know that std.format is quite template-heavy; even a single use of it can trigger the instantiation of quite a large number of templates.
Comment #10 by andrej.mitrovich — 2013-09-11T17:27:11Z
It looks like these issues were all caused by my pull request. Well don't I feel like a bastard now. :)
I do hope this is fixed in the compiler rather than to have to hack around it in Phobos.