<br><br><div class="gmail_quote">On Fri, Apr 6, 2012 at 6:18 PM, Peter Penz <span dir="ltr"><<a href="mailto:peter.penz19@gmail.com">peter.penz19@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,<br></blockquote><div><br>Hey Peter<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
As mentioned in my mail 2 days ago I'm using Nepomuk's ResourceWatcher to be able to reflect resource/property-changes in Dolphin's view.<br>
<br>
It works quite fine already but I observed a few implementation issues in ResourceWatcher that affect the performance in a bad way... I guess it should be no big deal to fix them, however please let me explain first how I use the ResourceWatcher in Dolphin:<br>

<br>
Dolphin resolves meta-data of directory-items step by step to prevent that the user-interface gets blocked. So when opening a directory with lets say 20000 items the ResourceWatcher gets used like this:<br>
<br>
1. After receiving the 20000 items from KDirLister an instance of ResourceWatcher is created and ResourceWatcher::start() is invoked.<br>
<br>
2. Asynchronously resolve the metadata of item 1:<br>
   - Read the meta-data and apply it to the Dolphin-model<br>
   - Add item 1 as resource to the ResourceWatcher (ResourceWatcher::addResource(<u></u>)).<br>
<br>
3. When entering the next event-loop resolve the metadata of item 2<br>
   ...<br>
<br>
4. Resolve the metadata of item 3<br>
   ...<br>
<br>
5. ... and so on (20000 times)<br>
<br>
Now to the problems:<br>
<br>
- Invoking ResourceWatcher::start() in step 1 without added resources blocks the process (at least in my environment) for a few seconds. The problem is gone if I invoke start() after at least one resource has been added.<br>
</blockquote><div><br>From what I remember, the dbus call is blocking. It really shouldn't be.<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

- Invoking ResourceWatcher::addResource() after invoking ResourceWatcher::start() has no effect. As workaround before adding a resource I needed to invoke ResourceWatcher::stop(), add the resource and invoke ResourceWatcher::start() again. The problem with this workaround is the performance: Calling stop() clears e.g. 15000 items and calling start() after adding one resource adds 15001 items again. In the case of the directory with 20000 this might take up a few seconds for each (!) of the items in the upper-range.<br>
</blockquote><div><br>I see.<br><br>Btw, from a performance perspective, it would be better if you only monitored the resources and properties you're interested in. In your case that would be nao:numericRating and nao:hasTag.<br>
  <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Please note that calling ResourceWatcher::start() after resolving the metadata of the 20000 items is way too late, the data can already be changed during the resolving. Also adding 20000 resources in one step takes around 110 seconds here :-/<br>

<br>
>From a quick look at the implementation I guess it should not be too tricky to let the ResourceWatcher internally be aware whether it has been started already or not and to consider this when adding a new resource without doing an expensive stop/start call.<br>

<br>
It would be great if this could be fixed by the Nepomuk-team but I'm aware that your time is limited. So my question: Should I submit a bug-report and is it realistic that you can fix this before 4.9.0? Or should I try provide a patch?  My time is also limited and I'd prefer the "Nepomuk-team-fixes-it"-<u></u>option, but without a fix this would be a kind of showstopper from a Dolphin perspective and... - well, I'd provide a patch if you cannot work on this ;-)<br>

<br>
Still crossing my fingers that you say "no big deal, easy fixable"...<br></blockquote><div><br>I'll try it out and look at it.<br><br>I'm a little busy till Friday, so I'll probably look at it over the weekend.<br>
 <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks,<br>
Peter<br>
<br>
______________________________<u></u>_________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/<u></u>listinfo/nepomuk</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>