D is one of the fastest programming languages to compile, if not the fastest, but this isn't always the case. Things become painfully slow when unittest is turned on. My current project has 6-7 modules (~2000 LOC), with every single one of them having unittests that also contain benchmarks. Here are some numbers from my current project:
dmd -O -noboundscheck takes 0m1.287s
dmd -O -release -noboundscheck takes 0m1.382s
dmd -O -inline -noboundscheck takes 0m1.499s
dmd -O -inline -release -noboundscheck takes 0m3.477s
adding -unittest to any one of the above will drastically increase compilation time:
dmd -O -inline -release -noboundscheck -unittest takes 0m21.918s
and sometimes it crashes DMD:
time dmd -O t1.d -inline -noboundscheck -version=Double -unittest takes 0m2.297s
Internal error: ../ztc/gdag.c 776
Evidentially, unittest is buggy but at the same time it has become an important part of my project. I would like to know if the slowdown is normal or is it something that's being worked on? My project is growing and with every new unittest the compilation is taking longer and longer. The only solution I know is to disable -release and -inline, but that's not always desirable.