<div dir="ltr">Ian,<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 7:04 PM, Ian Wadham <span dir="ltr"><<a href="mailto:iandw.au@gmail.com" target="_blank">iandw.au@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jeremy,<br>
<br>
Great work!<br>
<span class=""><br>
On 31/01/2015, at 10:34 AM, Jeremy Whiting wrote:<br>
> Ok, I took a deep look inside kbuildsycoca5 today. I ran Instruments on it and found as Marko already pointed out most of the time spent in there is delving deep into /Applications subfolders. I'm not sure exactly what it's looking for, mostly .desktop files from what I saw, but it's not finding any. Traversing the whole tree is time consuming though, and we know it's not likely to find .desktop files inside any .app bundles, so I added the attached patch and that sped up both kbuildsycoca5 itself (running from the terminal manually) as well as makes kded5 responsive from what I can tell. I also ran kmahjongg and was able to save a game, though I got a warning about being unable to launch klauncher. I believe that's because it's .service file that dbus uses to launch it is not pointing at the executable. I'll look into that issue tomorrow.<br>
<br>
</span>As far as I can tell, Apple OS X does not use the main *.desktop files when launching<br>
applications (I mean files like ksudoku.desktop). There are also *.desktop files used,<br>
for example, by games to record details of graphics themes. But the ones that really<br>
matter, from the point of view of not breaking KDE4/KF5 applications, are those used<br>
to locate plugins, KParts and services (I hope I have used the right terms). When KBS<br>
finds those *.desktop files, the apps that use them are no longer broken on Apple OS X.<br></blockquote><div><br></div><div>Right, a quick find in my kdesrc-build prefix (/usr/local/share) for .desktop files shows these subfolders:</div><div> - applications</div><div> - bomber/themes</div><div> - carddecks/*</div><div> - kf5/locale/countries/*/</div><div> - kf5/locale/currency/</div><div> - kmahjongg/layouts/</div><div> - kservices5/</div><div> - kservices5/cantor/</div><div> - kservicetypes5/</div><div> - ktuberling/pics/</div><div> - kxmlgui5/parley/themes/</div><div> - locale/en_US/kf5_entry.desktop <-- this one is just a .desktop of translated language names, in every translated language. We used to use this in kanagram/khangman, but with Qt 5 we simply use QLocale instead</div><div> - picmi/themes</div><div> - plasma/desktoptheme/*/ <-- no idea what these are for, we most definitely don't need them though imo. Seems like a workspace only runtime requirement.</div><div><br></div><div>Of those I can see each application needing it's own .destop files read, but not by kbuildsycoca5 I don't think, since it's looking in ApplicationsLocation and these aren't under there even on linux. I think there's some other mechanism that's helping find those at runtime iirc. Parley for instance which uses a copy (shame on parley I know) of kgtheme uses QStandardPaths::locateAll in GenericDataLocation/parley/themes to find .desktop files and read them. I guess the original KGTheme probably does similarly.</div><div><br></div><div>As for KParts and services I think most of those come from either kservices5, kservicetypes5. I'm not sure if those sets of data are cached by kbuildsycoca5 or not, but they aren't by the code path that's taking a while on osx currently (VFolder::loadApplications). For example filelight which has a kpart has installed /usr/local/share/kservices5/filelightpart.desktop here. As for services I think those are all defined as dbus services in $PREFIX/share/dbus/services/*.service</div><div><br></div><div>BR,</div><div>Jeremy</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> Anyway, if you want to test this patch I'll post it on reviewboard once someone else has confirmed it improves kbuildsycoca5 slowness. This brings us one step closer imo.<br>
><br>
> David,<br>
><br>
> Could you point me at some documentation or explain to me a bit what the difference between kinit, kded, kbuildsycoca and klauncher is? I know kbuildsycoca checks for system configurations and caches them, like contents of .desktop files and such, but I'm not sure where the others fit in or what they are for exactly.<br>
><br>
> thanks,<br>
> Jeremy<br>
><br>
> P.S. uncommenting the qDebug in there is just for testing, when I push this to reviewboard I'll remove that change.<br>
<br>
</span>We are going to need lots more qDebugs and even a few "fprintf(stderr," lines<br>
to get to the bottom of what kded5, klauncher5 and kded5 are executing when<br>
they go wrong on Apple OS X…<br>
<br>
Cheers, Ian W.<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
<a href="mailto:kde-mac@kde.org">kde-mac@kde.org</a><br>
List Information: <a href="https://mail.kde.org/mailman/listinfo/kde-mac
KDE/Mac" target="_blank">https://mail.kde.org/mailman/listinfo/kde-mac<br>
KDE/Mac</a> Information: <a href="http://community.kde.org/Mac" target="_blank">http://community.kde.org/Mac</a><br>
</div></div></blockquote></div><br></div></div>