[Qbs] Qbs (way) faster than cmake (or benchmark issue)

resurrection at centrum.cz resurrection at centrum.cz
Mon Jul 22 09:57:36 CEST 2019

What is the reason for the difference between compiler calls with moc between Qbs and CMake/Ninja? It looks like Qbs is actually compiling the moc stuff separately while CMake/Ninja don't or rather they compile it as part of other sources somehow? It would explain both the longer time they take and the paralellism decline. At any rate that CMake/Ninja don't understand it could do it differently (more efficiently) is their flaw obviously.
More generally though one could argue that the comparison is not really fair since CMake is not a build system (unlike Qbs) but just a build generator so it naturally cannot do as much in optimizing builds as Qbs (or any actual build system) can. No matter how hard you would try doing "CMake project description -> Ninja makefiles -> Ninja build" will always be inferior to "Qbs project description -> Qbs build" beacuse of that translation layer.
> Od: "Christian Gagneraud" <chgans at gmail.com>
> Komu: "qbs" <qbs at qt-project.org>
> Datum: 22.07.2019 01:00
> Předmět: Re: [Qbs] Qbs (way) faster than cmake (or benchmark issue)
On Tue, 16 Jul 2019 at 18:29, Christian Gagneraud <chgans at gmail.com> wrote:
 > Hi there,
 > I finally found time to start my qbs vs cmake build perf.
 > What i found is that qbs beats cmake 'big time' on my build machine
 > and i was actually surprised, so surprised that i'm trying to find
 > where is the mistake.
 Here is a graph showing qtcreator build time vs number of parallel
 jobs, using cmake and qbs.
 Builds were done in a docker container (same for both), stock Ubuntu
 19.04/amd64, all dependencies (inc. qbs tool and dev libs) installed
 using apt.
 Number of compilations were measured by generating a Clang compilation
 database and counting the number of entries:
 cmake: 2881 (2869)
 qbs: 4362 (2848)
 The first number is the number of compiler calls, the second number if
 the same but ignoring the pattern 'moc_'.
 Using 2 jobs:
 qbs: 26:30.78
 cmake: 30:11.44
 =>Cmake is 15% slower than qbs
 Using 56 jobs:
 qbs: 2:35.95
 cmake: 4:33.79
 => CMake is 75% slower than bqs
 At the 20 jobs mark, cmake start to stagnate, whereas qbs still make
 use of parallelism, at the 30 jobs mark, cmake completely stopped
 reducing overall build time, whereas qbs start to stagnate. At the 40
 jobs mark, both systems are stale.
 Qbs mailing list
 Qbs at qt-project.org
 https://lists.qt-project.org/listinfo/qbs <https://lists.qt-project.org/listinfo/qbs>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20190722/84a6c643/attachment-0001.html>

More information about the Qbs mailing list