No subject


Fri Mar 7 15:32:22 PST 2014


Re: [lldb-dev] MSBuild vs. Ninja build-timings on Windows
From:	Nico Weber <thakis@>
To:	"lldb-dev at cs.uiuc.edu" <lldb-dev at cs.uiuc.edu>
Date:	20150104 02:42

For why ninja is faster than other build systems, it depends if you look at
full or incremental builds.

For full builds, build speed is mostly related to how many compile
processes can be run in parallel. Many build systems add a "target"
abstraction and then do scheduling at a target level, which means if a
static library depends on another static library, all translation units in
the first static library have to be compiled first and then linked into a
static library before any compilation in the second library can start.
Since compiling source files can't depend on a static library being present
or not, this is an artificial limitation that needlessly serializes the
build. Ninja only gets a description of the build graph, and cmake is smart
enough to write build graph descriptions that do not make compiles of a
downstream target depend on an upstream static library, for example.

For incremental builds, ninja is fast because it does less: It only reads
build manifests and header deps (which are written into a single deps log
at build time, so it's only a single file to read), stats all input files,
and does nothing else. Other systems often have an imperative (instead of a
declarative) build description and run some scripts on every build
unconditionally, they read and write ancillary files, and so on.

Nico


More information about the macports-dev mailing list