[Nepomuk] Review Request: kinotify: Conserve memory by only storing a file name once

Commit Hook null at kde.org
Thu Dec 6 08:45:18 UTC 2012


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


This review has been submitted with commit 612502c088bccd6fc1c54bcde487a7cfbe6426c5 by Vishesh Handa to branch master.

- Commit Hook


On Dec. 2, 2012, 5:57 p.m., Vishesh Handa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107556/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2012, 5:57 p.m.)
> 
> 
> Review request for Nepomuk, Sebastian Trueg and Simeon Bird.
> 
> 
> Description
> -------
> 
>     kinotify: Conserve memory by only storing a file name once
>     
>     We need to map each url to its watch descriptor. This is done via a
>     QHash<QByteArray, int>. Since the byte arrays over here are file urls,
>     they share common prefixes.
>     
>     Example - '/home/vishesh' and '/home/vishesh/Documents'.
>     
>     Instead of storing each one separately, we split the byte array, and
>     store it in a vector ['home', 'vishesh'] and ['home', 'vishesh',
>     'Documents']. Additionally, we make sure only one copy of each string
>     exists. This is done automatically by Qt's reference counted containers.
> 
> 
> Diffs
> -----
> 
>   services/filewatch/kinotify.cpp e540f76 
>   services/filewatch/optimizedbytearray.h PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/107556/diff/
> 
> 
> Testing
> -------
> 
> Memory usage decreased from 20.3 to 18.2 mb. So we save about 2mb. It's not much, but it could be a LOT more based on the user's filesystem.
> 
> 
> Thanks,
> 
> Vishesh Handa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121206/b49b0135/attachment.html>


More information about the Nepomuk mailing list