3 ms·
Ninja hasn't been created for small one-liners like in this blog post, but for massive C++ builds with tens- or hundreds-of-thousands of source files arranged i
by flohofwoe 6y ago
Ninja hasn't been created for small one-liners like in this blog post, but for massive C++ builds with tens- or hundreds-of-thousands of source files arranged in a complex dependency tree.
Figuring out quickly what needs to be rebuilt for massive builds like this isn't trivial, but that's essentially the one important thing that ninja does.
Also see:
https://ninja-build.org/manual.html#_design_goals https://ninja-build.org/manual.html#_design_goals
- AtlasBarfed 6y ago... What mechanism is used to perform incremental builds? It is referenced in the article and unexplained from what I can tell. What enables "quickly" for you to determine what needs to be built? Make simply compares timestamps I believe. ... What mechanisms/tricks speed up builds? Or is it just the "simplicity" that is the BFD? Edit: It sure would have been helpful if somewhere was stated: "the build system of Chrome":-) That statement indicates a huge difference between some rando build system on someone's personal project, and a build system on operating-system-size codebase that is over a decade old.
- busrf 6y agoNinja uses time stamps. See the “Comparison to Make” section in the linked manual.
- sbierwagen 6y agoIsn't using mtime a bad idea? https://news.ycombinator.com/item?id=18473744 https://news.ycombinator.com/item?id=18473744
- slavik81 6y agoNo? The top comment in that thread is the author of Ninja discussing how he addressed the problems described in the article. And, despite its title, the article itself goes on to discuss why and how to use mtime in a build system.
- bla3 6y agohttp://www.aosabook.org/en/posa/ninja.html http://www.aosabook.org/en/posa/ninja.html is a book chapter in why ninja is fast.
- DerDangDerDang 6y agoI'm not sure it's the responsibility of others to ensure you have enough information not to look silly in a hasty post ;)