r/cpp • build2 • Aug 05 '26

Faster Than Ninja

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

69 comments sorted by

View all comments

Show parent comment

1

u/berium build2 Aug 06 '26

I wonder how much of the difference scales vs is constant factors and what the scaling function is.

I can't really give you hard numbers because we don't often benchmark build2 vs CMake (I assume your question is about the configuration phase). Even if we wanted to, it would be pretty difficult to do on any substantial project because the way we handle dependencies, etc., diverges too much to be meaningfully comparable.

But we had our scaling issues when it comes to configuration and a large number of dependencies, especially intra-dependent dependencies. I bet you can even guess where those intra-dependent dependencies came from: yes, from Boost.

Here is an issue where we tracked this: https://github.com/build2/build2/issues/184 And we now have a synthetic project to test for regressions in this area: https://github.com/boris-kolpackov/boost-dependency/

To give you an idea, on my machine the configuration phase for this project currently takes about 3 seconds. It has 76 dependencies, mostly from Boost. Also keep in mind that you would normally do this step a lot less often than with CMake. For example, you don't do it every time you add a source file to your project.