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

Denis Shienkov denis.shienkov at gmail.com
Wed Jul 17 08:53:51 CEST 2019


Hi,

>time qbs -f ../qtcreator.qbs -j $jobs profile:qt-5-12-2
>project.withAutotests:false
>vs
>cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG="-O0 -g" -G Ninja ..
>time ninja -j $jobs

Is QBS's default profile is debug too? Because for CMake you set
-DCMAKE_BUILD_TYPE=Debug.

> Maybe the use of -pipe has noticeable effects.

You can play with QBS project to tyne it with same flags as are used in CMake.
I meant, to modify the source qtcreator.qbs project to minimize differences. :)

17.07.2019 9:19, Christian Gagneraud пишет:
> On Tue, 16 Jul 2019 at 18:29, Christian Gagneraud <chgans at gmail.com> wrote:
>> The compiler flags are not the same, but not so far off:
>> Qbs: -g -O0 -Wall -Wextra -m64 -pipe -fexceptions -fvisibility=hidden
>> -fvisibility-inlines-hidden -fPIC
>> CMake: -g -O0 -std=c++14 -fvisibility=hidden
>> -fvisibility-inlines-hidden -fPIC -fstack-protector-strong -Wformat
>> -Wformat-security
> Maybe the use of -pipe has noticeable effects.
> I'm currently running builds with incremental parallel jobs and i
> record the load average history.
> When building with Qbs I can clearly see "stairs" (except for high
> parallel jobs), with CMake it's difficult to spot as if there was a
> lot of noise.
>
> As well, i've now disabled building unit tests and qbs when building
> with qbs, the comparison should now be more fair:
> time qbs -f ../qtcreator.qbs -j $jobs profile:qt-5-12-2
> project.withAutotests:false
> vs
> cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG="-O0 -g" -G Ninja ..
> time ninja -j $jobs
>
> Qbs builds QtCreator in 2:46, ninja in 4:55 (not counting the initial
> cmake call which would add 5+ seconds), the ratio is 0.56, basically
> Qbs is twice as fast when using all the available cores on this
> particular machine/env.
>
> I think i'll try to match the compiler flags exactly, and use tmpfs
> for /tmp and the build dir. This should remove most of the IOs "noise"
>
> What i've noticed so far is that ninja use a shell to run the
> compiler, and AFAIU, ninja calls "cmake -E cmake_autogen", to handle
> Qt's moc. Weird....
>
> Chris
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs


More information about the Qbs mailing list