[Nepomuk] Review Request: kinotify: Conserve memory by only storing a file name once
Simeon Bird
bladud at gmail.com
Tue Dec 4 03:36:33 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107556/#review22953
-----------------------------------------------------------
Ship it!
Nice!
- Simeon Bird
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/20121204/ba7f370d/attachment.html>
More information about the Nepomuk
mailing list