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

Dawit Alemayehu adawit at kde.org
Sat Jun 8 01:02:40 BST 2013



> On June 7, 2013, 12:32 p.m., David Faure wrote:
> > kio/kio/kdirlister.cpp, line 648
> > <http://git.reviewboard.kde.org/r/110834/diff/2/?file=148962#file148962line648>
> >
> >     This seems potentially very slow to me.
> >     When navigating away from a dir and there's a large tree view with many files in the same process, this is going to take a very long time.
> >     What was wrong with the QCache idea?

Well to me it seems that the benefits of QCache, automatic maintenance of the cache, seems to be its weakness for a particular use case. When copying or modifying lots of files such as images, videos etc on network shares, the QCache can potentially remove items that are still being modified/copied there by causing the stat to be performed again. Would that not put us back into the same position ? Granted not as many stats will be performed but that would depend on QCache's maxCost setting and the number of files being modified or copied. That is why I opted not want to use QCache in this case.


> On June 7, 2013, 12:32 p.m., David Faure wrote:
> > kio/kio/kdirlister_p.h, line 426
> > <http://git.reviewboard.kde.org/r/110834/diff/2/?file=148963#file148963line426>
> >
> >     The name gives me another idea, why not store this in DirItem directly? 
> >     Maybe the info is already there, even.

Hmm... interesting, but how do we look up the dirty item if we store this in DirItem? By DirItem do you mean the itemsInUse cache itself?


- Dawit


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


On June 7, 2013, 5:03 a.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110834/
> -----------------------------------------------------------
> 
> (Updated June 7, 2013, 5:03 a.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/20130608/2be11148/attachment.htm>


More information about the kde-core-devel mailing list