On 03/02/2017 02:22 AM, Yale Zhang wrote:
It's not just the Windows builds that are slow. Any where you use the generated UNIX makefiles, it will be slow.
Has anyone benchmarked Ninja vs GNU make build times for a one line change on Linux?
I was curious so I tested it (Debian jessie 64 bit) and measured the times. Ninja is consistently faster but now by much in most cases.
== Not changing anything in the sources and rebuilding ==
"make -j8" without changing anything real 0m7.342s user 0m12.732s sys 0m1.384s
"ninja -j8" without changing anything real 0m0.239s user 0m0.200s sys 0m0.028s
== Changing a single file and rebuilding ==
"make -j8" after "touch src/2geom/path.cpp" which triggers re-compilation of path.cpp and relinking of lib2geom, libinkscape_base, inkscape, tests etc. real 0m20.341s user 0m35.060s sys 0m3.892s
"ninja -j8" after "touch src/2geom/path.cpp" real 0m15.573s user 0m22.352s sys 0m2.444s
== Changing a couple of files and rebuilding ==
"make -j8" after "touch src/2geom/*.cpp" real 0m34.858s user 2m21.760s sys 0m15.516s
"ninja -j8" real 0m28.501s user 2m3.020s sys 0m13.848s
== I'm working on lib2geom (outside Inkscape) and changed things in path.cpp so I measured the build times too ==
"make -j8" real 0m16.633s user 1m18.732s sys 0m9.208s
real 0m16.219s user 1m19.020s sys 0m9.496s
real 0m16.680s user 1m18.376s sys 0m9.856s
"ninja -j8" real 0m15.840s user 1m16.016s sys 0m8.580s
real 0m15.782s user 1m15.784s sys 0m8.728s
== Re-building Inkscape from scratch ==
"cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../trunk/" real 0m9.123s user 0m6.300s sys 0m0.888s
"ninja -j8" on the freshly generated ninja files, building the whole project: real 7m8.485s user 49m15.668s sys 5m7.628s
"cmake -DCMAKE_BUILD_TYPE=Debug ../trunk/" real 0m10.208s user 0m7.100s sys 0m1.160s
"make -j8" real 7m18.929s user 49m17.140s sys 5m19.080s
Best Regards, Alexander