ninja-build / ninja

a small build system with a focus on speed
https://ninja-build.org/
Apache License 2.0
11.28k stars 1.6k forks source link

Add comparisons with other build systems #1709

Open sesam opened 4 years ago

sesam commented 4 years ago

The bread and butter of non-mainstream tools these days is having a couple of comparison pages that compare and contrast their own product with the main known ones. These typically go a couple links away from the home screen, and function as landing pages for anyone trying to understand the new software in terms of the old. And the author typically explain where their own product shines, and where it cannot (yet? PRs accepted, etc) compete.

(I came here to say that, and to try to find what build system Chromium uses, or used to use, in concert with the - then - newly popular linker gold.)

jhasse commented 4 years ago

There's already a comparision to make: https://ninja-build.org/manual.html#_comparison_to_make

sesam commented 4 years ago

Yes, I'm hoping for more like that. Do you know which you want to / don't want to compare with?

jhasse commented 4 years ago

Waf, Tup, Bazel are interesting build systems somewhat comparable to Ninja.

sesam commented 4 years ago

Thank you! bazel is the one I'd like to compare with. tup I've also heard of. I can nake a try to gather info on those for a start, maybe find some tables of features and authors' suggested use cases.

On Tue, Dec 17, 2019, 11:11 Jan Niklas Hasse notifications@github.com wrote:

Waf, Tup, Bazel are interesting build systems.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ninja-build/ninja/issues/1709?email_source=notifications&email_token=AAACFWLHHY3AKQIMU2HRK3DQZCQUZA5CNFSM4J3XJW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHB3PHQ#issuecomment-566474654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACFWLAJGVW5JUATZYCDS3QZCQUZANCNFSM4J3XJW6A .

jhasse commented 4 years ago

Not sure if ninja's site is the right place though, as it's biased.

mathstuf commented 4 years ago

Not only that, but Waf, Tup, and Bazel are not in the same class as ninja. The former are full build systems (well, Tup is closer to build tool I suppose). Ninja is really just a build executor (like make).

jhasse commented 4 years ago

They include a build executor though, which can be compared to Ninja.

data-man commented 4 years ago

I played with fastbuild and tundra. Also there is ninja-compatible samurai.

mathstuf commented 4 years ago

They include a build executor though, which can be compared to Ninja.\

True.

Also there is ninja-compatible

shake also implements build.ninja features. I don't think any of the other implementations support dyndep yet though.

sesam commented 4 years ago

I had no idea there are so many build tools on the market. Now it got even harder to pick the right too for the task. samurai looks like a strong competitor. I read the make comparison, and now I remember that ninja's main value add is in comparison to make. How deterministic are ninja builds?

Hi-Angel commented 4 years ago

FWIW, Meson has a table where can be seen comparison of Make with Ninja https://mesonbuild.com/Simple-comparison.html

ClausKlein commented 4 years ago

IMHO, the simple mesonbuld comparison should be extended to 100 sub directories with 10 files linked to 10 libs. That would be more realistic!

Hi-Angel commented 4 years ago

IMHO, the simple mesonbuld comparison should be extended to 100 sub directories with 10 files linked to 10 libs. That would be more realistic!

If you feel like it, you can take the original scripts that were used for the benchmark, modify them, run the test, and suggest for inclusion into Meson docs. But I'd suggest asking first Meson devs what are their thoughts about it. Meson has for example IRC channel #mesonbuild on Freenode server.

waruqi commented 4 years ago

And xmake build system

ClausKlein commented 4 years ago

After many tests with real projects, IMHO cmake and ninja (and ccache) is the fastest. i.e.:

**Running command: rm -rf build-cmake-ninja && mkdir -p build-cmake-ninja && CXX=g++ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -G Ninja -B build-cmake-ninja .
Running command: ninja -C build-cmake-ninja
Running command: ninja -C build-cmake-ninja
Running command: ninja -C build-cmake-ninja clean
Running command: ninja -C build-cmake-ninja
Running command: rm -rf build-meson && mkdir -p build-meson && CXX='ccache g++' meson build-meson
Running command: ninja -C build-meson 
Running command: ninja -C build-meson 
Running command: ninja -C build-meson clean
Running command: ninja -C build-meson 
cmake-ninja
 4.669 gen
 0.860 build
 0.021 empty build
 0.040 clean
 0.735 rebuild
 6.325 overall
meson
 6.111 gen
 1.524 build
 0.014 empty build
 0.031 clean
 1.550 rebuild
 9.231 overall
Claus-MBP:jsoncpp clausklein$ 
waruqi commented 4 years ago

xmake(v2.3.2) & ninja & cmake

The test project: xmake-core

Multi-task parallel compilation

buildsystem Termux (8core/-j12) buildsystem MacOS (8core/-j12)
xmake 24.890s xmake 12.264s
ninja 25.682s ninja 11.327s
cmake(gen+make) 5.416s+28.473s cmake(gen+make) 1.203s+14.030s
cmake(gen+ninja) 4.458s+24.842s cmake(gen+ninja) 0.988s+11.644s

Single task compilation

buildsystem Termux (-j1) buildsystem MacOS (-j1)
xmake 1m57.707s xmake 39.937s
ninja 1m52.845s ninja 38.995s
cmake(gen+make) 5.416s+2m10.539s cmake(gen+make) 1.203s+41.737s
cmake(gen+ninja) 4.458s+1m54.868s cmake(gen+ninja) 0.988s+38.022s