HeadlinesBriefing favicon HeadlinesBriefing.com

Build2 Matches Ninja Speed in Xerces-C++ Build

Hacker News •
×

I read an article about a tool that snoops on slow build systems. A striking quote noted that Ninja isn’t a fair benchmark because it benefits from baked‑in logic the tool that creates the ninjafile supplies.

The article measured a full from‑scratch build of Xerces‑C++. Ninja finished in 3.4s while CMake took 15.6s to generate the ninjafile, implying a total of 19s for a dependency build. build2 ran in 3.8s—just 11% slower.

To make the comparison tighter, the author disabled build2’s precise change tracking and compression. titanium‑level features were turned off, turning it into a read‑only project. The time dropped to 3.4s, then to 3.355s, 2.2% faster than Ninja. Even with the extra work of generating headers and extracting compiler information, build2’s design keeps it on par or better than Ninja.

The secret lies in different design choices: minimal overhead, smarter change tracking, and avoiding unnecessary steps, rather than incremental tweaks to a legacy system.