On 03-11-18 20:39, Chris Bare wrote:

It seems like this is a common question for D in general, but what things can I do to speed up building gtkD programs?

I read that making gtkD a shared library make the link (which takes most of the time) go faster, but I haven't found any instructions on how to make a shared library with D.

Is it worth creating .di files for gtkD? if so, is there any way to get dub to do it? I tried manually and there were a lot of dependencies I'd have to figure out the paths for.

Any other ideas I've missed?

I'm using a Core i7-5930K CPU @ 4GHz and a build of the gtkD hello world example takes over 9 seconds when gtkD is already built and I just change app.d.

Using the gold linker vs gcc ld brings 8.8 seconds down to 1.5 seconds, but I don't see a way to use that with dub. I could always just write my own Makefile.

Thanks for any suggestions.


The GtkD makefile allows building GtkD as a shared library using:

$ make shared-gtkd
# make install-shared-gtkd

You should then be able to specify the shared libraries in the libs
option of the dub build file.