Review Request 110834: Cache the result of the KDE::stat calls in KDirListerCache::slotFileDirty

David Faure faure at kde.org
Thu Jun 6 22:15:02 BST 2013


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


Nice catch. The usual thinking of "one stat call, that can't be too bad" indeed breaks when it's done repeatedly, and over NFS.

A few issues with the patch, though.


kio/kio/kdirlister.cpp
<http://git.reviewboard.kde.org/r/110834/#comment24941>

    This is missing a if (src.isLocalFile()). The src url might not be local, here.



kio/kio/kdirlister.cpp
<http://git.reviewboard.kde.org/r/110834/#comment24942>

    add ,Unknown as second argument, so that this doesn't rely on the enum value being 0, implicitly.



kio/kio/kdirlister_p.h
<http://git.reviewboard.kde.org/r/110834/#comment24943>

    This cache will just grow and grow and grow, in a given process, since you're not removing from it when we navigate away from the directory.
    
    Please switch to QCache, so that the size doesn't keep growing indefinitely, but instead the oldest items will be removed when it reaches a certain size.


- David Faure


On June 6, 2013, 12:45 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110834/
> -----------------------------------------------------------
> 
> (Updated June 6, 2013, 12:45 p.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Description
> -------
> 
> This patch, inspired by the issue reported in bug# 317676, attempts to cache and reuse the original result from the stat call in KDirListerCache::slotFileDirty. Since that stat call is only needed to determine whether the "dirty" resource is a file or directory, caching the result helps us avoid the potential for tons of KDE::stat calls. The stat will happen if you for example copy or download a large file into a local folder while that folder is being viewed in a file browsing app such as dolphin or konqueror. The cached information is removed if the resource being monitored is deleted or renamed.
> 
> 
> This addresses bug 317676.
>     http://bugs.kde.org/show_bug.cgi?id=317676
> 
> 
> Diffs
> -----
> 
>   kio/kio/kdirlister.cpp a721673 
>   kio/kio/kdirlister_p.h a78cc3c 
> 
> Diff: http://git.reviewboard.kde.org/r/110834/diff/
> 
> 
> Testing
> -------
> 
> The patch was tested by the bug reporter and it fixed the issue for him.
> 
> 
> Thanks,
> 
> Dawit Alemayehu
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130606/85bd7ecb/attachment.htm>


More information about the kde-core-devel mailing list