On Wed, Nov 4, 2015 at 1:07 PM, Evan Martin <
mar...@danga.com> wrote:
> This is awesome news!
>
> For some context for the greater outside-of-Google Ninja list, as far
> as I know the Android adoption of Ninja was separate from any of the
> existing Ninja developers (it was at least a surprise to me when I
> heard about it). I also don't know a lot about how all the pieces fit
> together.
>
> From my reading, it appears there are two projects around Android and Ninja.
> 1) kati[1] translates Makefiles to Ninja files.
> 2) soong[2] appears to use blueprint[3] to generate Ninja files
> directly from a higher-level Go description.
>
> It appears that this uses Kati. Do you have any comments on the
> status of Soong?
Soong is the longer term plan, and involves replacing all of the
Android.mk files throughout the tree with structured data files, and
describing the build logic in Go. In order to do a phased transition
from Makefiles to Soong, Kati will translate Makefiles to a Ninja
file, which will be combined with a Ninja file from Soong, and then
all built together with Ninja. Eventually when there are no more
Makefiles, Kati will be removed.
> The other thing I'm interested in is performance (of course!). The
> announcement says: "Incremental builds with a warm disk cache will
> start within 5 seconds.". That seems longer than I'd like -- if you
> get a chance, could you run a no-op build with the "-d stats" flag
> passed to Ninja and paste your results here? We have collected some
> timing numbers in the past on this wiki page that could help put them
> in context:
>
https://github.com/martine/ninja/wiki/Timing-Numbers
We run kati every time before running ninja, so the 5 seconds is not
entirely in ninja. kati needs to do a number of checks before
deciding the build.ninja file is up to date - it checks all referenced
environment variables, modification times on all referenced makefiles,
and reruns all $(wildcard) and $(shell) functions to make sure nothing
has changed.
On my build machine, a no-op build actually takes 7 seconds, around 4
of which are in ninja (1.6.0). Stats:
metric count avg (us) total (ms)
.ninja parse 1 2597182.0 2597.2
canonicalize str 1123566 0.1 147.5
canonicalize path 1123566 0.1 95.0
lookup node 1289308 0.2 276.2
.ninja_log load 1 253438.0 253.4
.ninja_deps load 1 371684.0 371.7
node stat 138522 1.5 206.8
path->node hash load 0.83 (324568 entries / 393241 buckets)
This is with a 328MB build.ninja file with 533k lines, 116k build
statements, 103k rule statements.