[Kde-pim] mixedmaildir optimization suggestion

Kevin Krammer krammer at kde.org
Thu Sep 20 14:45:26 BST 2012


On Thursday, 2012-09-20, Andras Mantia wrote:

> The cache itself is not invalidated automatically. The purpose of the cache
> was to limit the number of file stats (QFile::exists()) calls.
> Items can go into the cache if:
> - findRealKey is called on them, and they are not yet in the cache
> - the cache is completely refreshed (this runs two entryLists() calls and
> puts all files from cur and new into the cache)
> - items are copied/moved inside the resource with the Maildir lib methods
> 
> There is no automatic comparision of the cache time with the directory
> time, as that would involve a stat call, defeating the purpose of the
> cache.

Then I had a very wrong understanding of the how the cache works. My 
impression was that it only speeds up operations but does never report invalid 
data.

I would prefer to have a mode of libmaildir that lets it work properly by 
itself, e.g. as described above.

stat'ing just the directory for consistency check should still be way faster 
than stat'ing every file but would keep the API work in the way it was intended 
to.

Applications not caring about cache consitency would then use a different 
operation mode and invalidate the cache themselves or just not care about 
wrong answeres to API calls.

Something like

enum CacheStrategy {
  ConsitentCache,
  AgressiveCache
};

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120920/ed8d2861/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list