D support for the Meson build system
kinke via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Fri Apr 7 00:57:02 PDT 2017
On Monday, 22 August 2016 at 11:45:37 UTC, Matthias Klumpp wrote:
> One important thing about Ninja is that it will perform
> split-builds by default, so if you change something, only the
> changed piece needs to be recompiled. I *think* dub can do that
> too, but for some reason it never does it (even when using
> --parallel).
> That behavior drastically reduces compile times when working on
> a project.
So if I understand correctly, Meson/Ninja compile each module
separately, while dub builds them all in a single command line.
This makes quite a big difference. Compiling all at once requires
a full rebuild every time a single file is modified and implies
full single-threadedness. The advantages are that each file is
only loaded and parsed once, but much more importantly,
everything is emitted into a single object file, allowing for
implicit full cross-module inlining (across the compiled modules).
So while compiling each file separately in parallel is
potentially much much faster, the produced release binary may be
slower due to less/no cross-module inlining (e.g., LDC's option
is still experimental and known to have issues).
More information about the Digitalmars-d-announce
mailing list