Shared publicly  - 
 
Ninja build for Chromium/Mac
#chromium #work

Six months ago, +Robert Sesek and I made Chromium/Mac buildable with make (https://plus.google.com/u/0/101038813433650812235/posts/St5u7xTApoA). Building on that, +Jeremy Apthorp and I made Chromium/Mac buildable with ninja (http://martine.github.com/ninja/), a new build system with a focus on speed. This work is now complete, and I built Chromium with ninja and make under various circumstances and recorded build times (I did each measurement multiple times, to make sure there is not a lot of variance.)

Excerpts from the below data:
* Empty builds take ~1s with ninja, as opposed to 20s with make (and 2min with xcodebuild)

* On my laptop, an incremental release build (touch one source file, rebuild Chromium) goes from 40s (make) to 20s (ninja)

* Incremental release builds take up to 40% less time than debug builds (eg 36s instead of 60s)

* Something on my laptop (probably SSD or newer ld) makes incremental builds twice as fast as on my mac pro (clobber builds still take 13 minutes more on laptop)

* ninja is faster than xcode even when building from within the IDE (which has the deps graph cached in memory)

Because ninja's startup time is so fast, it can be used to build a "compile this file" function for scriptable editors:
http://src.chromium.org/viewvc/chrome/trunk/src/tools/vim/ninja-build.vim?view=markup
http://src.chromium.org/viewvc/chrome/trunk/src/tools/emacs/flymake-chromium.el?view=markup



Numbers:
macbook pro os x 10.7.2
(ssd, 8 cores, 8 GB ram, noncorp image, 10.6 sdk, xcode 4.2 toolchain + chrome clang)

Release

empty build (warm cache)
make: 21s
ninja: 0.9s

incremental build (touch one file in libbrowser, rebuild chrome target)
make: 38.7s
ninja:19.9s

full build of the chrome target
make: 35.5min
ninja: 33.5min

Debug

empty build (warm cache)
make: 21s
ninja: 0.9s

incremental build
make: 59.9s
ninja: 44.9s

full build
make: 36.3 min
ninja: 33.6 min



mac pro os x 10.6.8
(hard disk, 16 cores, 32 GB ram, corp image, 10.5 sdk, xcode 3.2.6 toolchain + chrome clang)

Release

empty build (warm cache)
make: 27s
ninja: 1.3s
xcodebuild: 1min 52s

incremental build
make: 1min 5s
ninja: 40s
xcodebuild: 3min 11s

full build
make: 21.3min
ninja: 19.6min
xcodebuild: 30min

Debug

empty build (warm cache)
make: 27s
ninja: 1.3s

incremental build
make: 1min 41s
ninja: 1min 16s

full build
make: 20 min
ninja: 18 min

http://code.google.com/p/chromium/wiki/NinjaBuild
14
5
Scott Byer's profile photoNico Weber's profile photo
 
You've made my Friday! Woot!
Add a comment...