public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* Faster incremental builds with Ninja
@ 2016-06-27 18:50 Rabin Vincent
  0 siblings, 0 replies; only message in thread
From: Rabin Vincent @ 2016-06-27 18:50 UTC (permalink / raw)
  To: linux-kbuild, linux-kernel

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-27 18:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27 18:50 Faster incremental builds with Ninja Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox