[kde-freebsd] News on Performance-Problems
Hannes Hauswedell
list_kde-freebsd at soulrebel.in-berlin.de
Sat Jul 26 19:46:54 CEST 2008
Hi everyone,
I spent most of today investigating the performance issues everyone(?)
of us is experiencing. Heres some interesting things I found out that
hopefully will help solving at least some performance issues:
First of all I found out that some performance problems are not
connected to kde4 but actually to qt4.4.0. This was obvious since an
application I develop, KPorts, is qt-only and start-up-time changed
from ~12seconds to ~3minutes upon upgrading qt-4.3.1 to qt-4.4.0.
I had a closer look at KPorts startup-functions to see where slowdowns
in qt can possily occur. The function that runs during start-up does
several things, which I wont explain in detail. It boils down to
disk-io(only reading), string-handling (splitting, sectioning..), and
creation of new objects.
By commenting out relevant passages I could proved that its neither of
the first two. So I thought it must something with memory allocation
during creation of objects. I wrote a test-app for that and found out
that allocating new QObjects is same speed on qt-4.3.1 vs qt-4.4.0.
(=> memory allocation isnt the problem)
Next things I checked was things going on in the constructors of the
objects and I found out that its the connect()-calls which somehow got
much slower from qt-4.3.1 to qt-4.4.0.
Sounds strange but it is the case. During startup of Kports about 80K
objects are created that each create 3 Signal-Slot-Connections to a
static object for error handling.
After temporarily removing the connect()-calls kports, startup-time went
from >3minutes to ~6seconds!!!
I wrote a test-application to benchmark creation of
signal-slot-connections and it confirms that creating a connection
takes at least twice as long with qt-4.4.0.
I attached the code, it creates 2million connections and tells you how
long it took. (note that you have to ctrl-c to quit the program).
Please check whether the time needed to create these connections on your
machines differs on qt-4.3.1 vs qt-4.4.0 as well. I have 10seconds on
qt43 vs 20seconds on qt44 ( I know that doesnt completely explain the
time difference in kports but it seems significant).
I'm not sure this problem is responsible for all performance issues, but
signal-and-slotting sure is used everywhere, so slowdown there could
explain a lot.
Greetings
Hannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perftest.tar.bz2
Type: application/x-tbz
Size: 878 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-freebsd/attachments/20080726/ab3165f4/attachment.bin
More information about the kde-freebsd
mailing list