[Interest] Qt 5.0.2 speed and widgets

Yves Bailly yves.bailly at sescoi.fr
Tue Apr 16 14:53:52 CEST 2013


Le 14/04/2013 19:55, Philippe a écrit :
> Compared to Qt 4.8.x, I experiment a very sensible reduction of speed
> in 5.0.2 when widgets are created or complex windows activated.
> In Release mode this is "sort of acceptable",... maybe half speed.
> But in debug mode, this is dramatically slower, up to 6x slower than in
> 4.8.3.

Just to have something to compare, here's a mini-benchmark I did using an
application I'm working on. Not a trivial one, about 80K SLOC in two libs
and an executable. What is benchmarked is the time needed to get a usable
GUI displayed.

First the application loads a bunch of data from a remote PostgreSQL
server. Almost purely "internal" operations, nothing more than a progress
bar. Then the GUI is build "on-the-fly" according to what is stored in the
database, almost no *.ui file involved. This produce around 20 dynamic
"forms", each showing between 10 and 30 user controls (buttons, line edits,
trees). A moderately large CSS is used, and no QML nor QtScript at all.

All tests done on the same machine/system, Windows 7 64bits 4-cores Xeon,
using the compilers from Microsoft Visual 2010. The Qt5 used is the one
downloaded from qt-project.org, the Qt4 (both 32bits and 64bits) compiled
by me from sources. Results from the third start, to avoid cache effects.

Debug mode
==========
                 +---------------+---------------+---------------+
                 | Data loading  | GUI building  | Cumul         |
----------------+---------------+---------------+---------------+
Qt 5.0.2 32bits |  5.0s /  36MB | 11.0s /  99MB | 16.0s / 135MB |
----------------+---------------+---------------+---------------+
Qt 4.8.4 32bits |  3.5s /  34MB |  8.0s /  94MB | 11.5s / 128MB |
----------------+---------------+---------------+---------------+
Qt 4.8.4 64bits |  3.3s /  51MB |  8.2s / 131MB | 11.5s / 182MB |
----------------+---------------+---------------+---------------+

Release mode
============
                 +---------------+---------------+---------------+
                 | Data loading  | GUI building  | Cumul         |
----------------+---------------+---------------+---------------+
Qt 5.0.2 32bits |  1.1s /  17MB |  1.9s /  63MB |  3.0s /  80MB |
----------------+---------------+---------------+---------------+
Qt 4.8.4 32bits |  0.9s /  17MB |  1.5s /  59MB |  2.4s /  76MB |
----------------+---------------+---------------+---------------+
Qt 4.8.4 64bits |  0.8s /  25MB |  1.5s /  80MB |  2.3s / 105MB |
----------------+---------------+---------------+---------------+


As usual, those results are to be taken with caution... however, it seems
fair to say Qt5 is slower than Qt4: +40% in debug mode, +25% in release mode.
While I don't mind much about debug mode (it's just annoying for developpers),
a 25% slowdown even in release mode is more of a concern.

For what it worths...


-- 
      /- Yves Bailly - Software developer   -\
      \- Sescoi R&D  - http://www.sescoi.fr -/
"The possible is done. The impossible is being done. For miracles,
thanks to allow a little delay."



More information about the Interest mailing list