In association with heise online

08 February 2011, 15:29

Ninja, a replacement for make, in Chrome's build system

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

After becoming dissatisfied during the development of Chrome with the performance of the Unix make, the standard program for generating executable programs, Evan Martin has developed Ninja as an alternative. The code for the free tool has now been made available on Github with the agreement of Martin's employer, Google.

Martin explains the reasons for the development of Ninja in his blog: originally Scons was used to create the single Chrome executable from 30,000 input files. It was found early on that the tool was "quite slow – it could take 40 seconds from starting Scons before it decided to build some source". Martin converted the build process to use make; this was much faster under Linux with incremental builds taking 10 to 20 seconds. He was not happy though with the 10 seconds of waiting between running make and it beginning compilation. Martin then took on the challenge of making the build run faster with a very simple build system, "conceptually very similar to Make, but without hardly any features". The result was Ninja, which took only one second to go from being started to starting to compile; in combination with other tools, an incremental Chrome build on a fast computer was timed "after editing one file at six seconds".

The new tool waives the use of implicit rules that make uses for the automatic creation of object files from C; the control files for Ninja mainly consist of rules and build statements. The rules are short names for longer commands, such as calls to the compiler, while the build statements use these rules to generate object or program files. Ninja has been made available under the Apache Licence 2.0.

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1185529
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit