Good build system?

burt invalid_email_address at cab.abc
Sat Aug 15 17:30:55 UTC 2020


On Saturday, 15 August 2020 at 15:45:44 UTC, Avrina wrote:
> What project are you compiling? It would help to diagnose the 
> problem, as well as what the specs of the computer you are 
> using are.

It is basically an implementation for a DSL, which has to parse, 
process and interpret it. The interpretation part has already 
been implemented and doesn't have to be recompiled (.lib), but it 
does have to link with it (which takes up quite a bit of time as 
well, because it has to redo it every time).

On Saturday, 15 August 2020 at 16:15:08 UTC, WebFreak001 wrote:
> [...]
>
> to speed up dub I recommend
>
> 1) split up your code base into multiple subpackages (isolated 
> packages of code as seen in vibe.d)
> 2a) try using --build-mode=allAtOnce which will compile the 
> entire project in one go (note that this will increase memory 
> usage)
> 2b) try using --build-mode=singleFile which will compile each 
> file separately and link them all together (note that this 
> eliminates any possible caching by the compiler, but reduces 
> memory usage which could also be a bottle neck)
>
> Of these steps 1) will definitely help while developing as it 
> will not recompile the packages which didn't change. 2a) or 2b) 
> can be useful if you are on a very beefy machine or have memory 
> constraints on a low level machine

Splitting it up into subpackages helped indeed. 
--build-mode=singleFile did not speed it up much, but it did show 
me where the bottleneck was: the compiler was taking FOREVER on 
parser.d (I mean minutes, for a 3000-line file), so it sure 
helped to split that one off. Maybe there's a ton of hidden 
template instantiations going on? Or there's a compiler bug 
somewhere? I don't know.

Linking is still taking very long; I'm compiling for 64-bit with 
the MS linker. Could using another linker or some other linker 
technique speed it up?

Thank you for your response.


More information about the Digitalmars-d mailing list