Speed-up built times with this simple trick
p0nce opened this issue · 1 comments
p0nce commented
Lastly, I got a surprisingly huge compile time speed up with one minor change: instead of mixin(item.replace(...)), I did static immutable x = item.replace(...); followed by mixin(x). This way the compiler wouldn't rerun the CTFE string replace every time, and instead cached it.
http://dpldocs.info/this-week-in-d/Blog.Posted_2020_01_06.html
p0nce commented
Best of 4 unittest builds with DMD + x86 + --force
With the mixin "optimization"
=> min 0m4.110s
=> mean 0m4.390s
Without the mixin "optimization"
=> min 0m4.104s
=> mean 0m4.562s
Well this is below the measurement noise and doesn't seem to make any difference.