option to disable kbuildsycoca check during kdeinit startup
Lubos Lunak
l.lunak at suse.cz
Thu Sep 23 18:54:44 CEST 2004
Hello,
the attached patch adds an option to disable scanning of most of the
directories containing .desktop files, i.e. kbuildsycoca only checks ksycoca
is actually usable, and kded doesn't set up KDirWatcher. This avoids reading
all those directories during KDE or kdeinit startup.
I created the patch because some asked for this at the SUSE Labs conference
while discussing various things related to performance. Their reason for this
was mostly starting KDE apps outside of KDE, when kdeinit needs to be run
first. Since all those directories containing .desktop files are usually not
in caches, scanning them takes some time.
The question, however, is if this would be actually worth it. If I try to
start KWrite outside of KDE, on 900MHz machine with 30+MiB/s HDD, after
cleaning caches by running a process that eats all memory and gets killed by
OOM-killer, I get this:
- kwrite run normally, i.e. kdeinit is started, kbuildsycoca is run, etc. :
9,5s
- with this patch: 8s
- first kdeinit is run, then caches are cleaned, then kwrite is run (i.e. only
actually KWrite startup with cold caches) : 6,5s
Which shows it's not that big improvement. The most expensive thing seems to
be actually getting all the other stuff from the HDD (libraries, whatever).
Note however that benchmarking anything with cold caches gives rather varying
results, so the numbers are hardly exact.
The price paid for this feature is that if a .desktop file is changed or a
new one is installed, kbuildsycoca won't notice. Cases like ksycoca missing,
having old version or similar are handled fine, also 60sec later kbuildsycoca
is rebuilt normally and KDirwatch is setup, so this is probably not that big
problem, but still it could cause trouble. It could be further reduced by
changing make install and packages to touch
$KDEDIR/share/services/update_ksycoca , but that wouldn't work with old KDE
apps and non-KDE apps.
The GUI (which doesn't exist yet) should be basically a checkbox in the
Performance kcm, with a 'Warning:dangerous!" or similar next to it, and a
pushbutton to run kbuildsycoca.
Alternative solution for "faster" startup of KDE apps outside of KDE would be
making the timeout for automatic kdeinit shutdown after last KDE application
goes away much longer, but then there's the problem with the X connections
blocking 'ssh -X' logout :(.
Comments, suggestions, yes/no?
PS: In case the patch goes in, it could use some checking. It's probably way
too hackish.
--
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27 tel: +420 2 9654 2373
190 00 Praha 9 fax: +420 2 9654 2374
Czech Republic http://www.suse.cz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kded.patch
Type: text/x-diff
Size: 5967 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20040923/5be71c59/kded.bin
More information about the Kde-optimize
mailing list