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

Vishesh Handa me at vhanda.in
Mon Aug 6 09:47:16 UTC 2012


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

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 658a521 

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/2862821f/attachment.html>


More information about the Nepomuk mailing list