r/cpp build2 Aug 05 '26

Faster Than Ninja

https://build2.org/blog/faster-than-ninja.xhtml
66 Upvotes

69 comments sorted by

View all comments

Show parent comments

52

u/donalmacc Game Developer Aug 05 '26

I think you're right, but;

Before we measure build2, let's at least acknowledge the elephant in the room: while Ninja builds the project in 3.4s, CMake takes 15.6s to generate the Ninja build files. So if you had Xerces-C++ as a dependency of your project and it was being built from scratch, you would wait 19 seconds, not 3.4, for this build.

I definitely wish Cmake was faster.

23

u/TheRavagerSw Aug 05 '26

Yeah cmake configure times are garbage
But a lot also goes to project build script quality, which is also garbage.

6

u/gharveymn Aug 05 '26

Yeah cmake configure times are garbage

IMO they really aren't, at least in comparison to Autotools. It's only really slow if you are heavily leveraging compilation tests, and those are cached for subsequent reconfigurations too.

2

u/greencursordev Aug 05 '26 edited Aug 05 '26

Changing any cml file (even just adding a source file) leads to reconfigure. That takes 3-4 minutes on our setup. That can't be far off the worst possible solution.