D is supposed to compile fast.

Chris Katko ckatko at gmail.com
Fri Nov 23 08:57:57 UTC 2018


Any time I see people mention the benefits of D, I see "compile 
times" "compile times" "compile times" over and over.

I'm using very modest amounts of templates, for a fairly small 
sized program (very early work toward a game), and I'm hitting 
~15 seconds compile time in LDC and ~7 seconds in DMD. And I'm 
not even compiling with optimizations!

ldc2 -w -ofextra  extra.d molto.d helper.d editor.d common.d 
map.d object_t.d animation.d ini.d  -L-L. $@    -gc -d-debug=3  
-de -fdmd-trace-functions

dmd -w -ofextra extra.d molto.d helper.d editor.d common.d map.d 
object_t.d animation.d ini.d -profile=gc  -profile  -g -debug 
-color -L-L.

I keep putting stuff into new files, but it feels like it's 
compiling everything from scratch / not getting faster the way 
C++ does.

And I'm not even bringing up the 800MB of RAM required because I 
dared to import std.regex. (On a laptop with 2 GB of RAM. RIP. If 
I dare to have tabs open, the compile time goes into the minutes 
thanks to swapping.)



More information about the Digitalmars-d-learn mailing list