Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432219 > unrolled thread

Faster incremental builds with Ninja

Started byRabin Vincent <rabin@rab.in>
First post2016-06-27 21:00 +0200
Last post2016-06-27 21:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Faster incremental builds with Ninja Rabin Vincent <rabin@rab.in> - 2016-06-27 21:00 +0200

#1432219 — Faster incremental builds with Ninja

FromRabin Vincent <rabin@rab.in>
Date2016-06-27 21:00 +0200
SubjectFaster incremental builds with Ninja
Message-ID<rOJVg-454-13@gated-at.bofh.it>
Ninja is a small build system with a focus on speed.  More details at
https://ninja-build.org/.

I made an experimental Ninja build file generator for the kernel.  The
purpose was to see how much we could decrease compile times (especially
to detect errors) for single file changes.  Results on my machine and
x86 defconfig:

| Change                    | make -j8 | make -j8 objectname | ninja  |
| --------------------------| -------- | ------------------- | ------ |
| No changes                |  2.254s  |       0.731s        | 0.065s |
| One change, compile error |  1.225s  |       0.765s        | 0.077s |
| One change, full link     |  5.915s  |       NA            | 4.482s |

The link time unsuprisingly dominates when performing small changes, but
as can be seen the time until the start of compilation (and thus the
time until any compile errors are detected) is several times smaller
with ninja.

These numbers were measured with the benchmark.sh included in the
repository.

  https://github.com/rabinv/kninja

I'm not posting the code as patches here since it's basically a hack.
It parses make's --print-data-base output and requires a full build to
have been performed with make before it can generate the ninja build
files.  Configuration changes and various files with special generation
rules are not handled.

Perhaps it is useful for "personal use" or as inspiration for
optimizations to Kbuild.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web