[Nepomuk] Review Request: kinotify: Do not store the paths to be added

Sebastian Trueg sebastian at trueg.de
Mon Aug 6 10:31:24 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105892/#review16958
-----------------------------------------------------------


The reason for the queue was to avoid having the thread block until all folders are added. I fear that with this change starting the service and then shutting it down will always result in a forceful killing. Sure, for production use this is better in most cases...

- Sebastian Trueg


On Aug. 6, 2012, 10:03 a.m., Vishesh Handa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105892/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2012, 10:03 a.m.)
> 
> 
> Review request for Nepomuk and Sebastian Trueg.
> 
> 
> Description
> -------
> 
>     kinotify: Do not store the paths to be added
>     
>     kinotify used a QQueue<QByteArray> to store all the directories which
>     need to be added. Since we use QDirIterator, each path is presented as a
>     QString which is then encoded to its QByteArray (QFile::encodeName).
>     This results in *large* chunks of memory being allocated, and then
>     slowly being deallocated.
>     
>     Instead, we now use a QDirIterator, and do not store all the directories
>     which need to be added, we simply iterate over them. This way we do not
>     allocate large amounts of memory.
>     
>     There is a large performance improvement as well. On my system, with
>     38829 directories, adding all the watches now takes only about 10 seconds,
>     instead of about 65.
>     
>     Patch possible due to massif output provided by Jure Repinc <jlp at holodeck1.com>.
>     Thanks a lot.
>     
>     tldr: Use DFS instead of BFS -> Less memory consumption
>     
>     BUG: 304476
> 
> 
> This addresses bug 304476.
>     http://bugs.kde.org/show_bug.cgi?id=304476
> 
> 
> Diffs
> -----
> 
>   services/filewatch/kinotify.cpp e8843c8 
> 
> Diff: http://git.reviewboard.kde.org/r/105892/diff/
> 
> 
> Testing
> -------
> 
> kinotify tests pass successfully.
> 
> 
> Thanks,
> 
> Vishesh Handa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20120806/34d06f40/attachment-0001.html>


More information about the Nepomuk mailing list