Review Request: Fix KIO listDir entries batching

David Faure faure at kde.org
Tue Dec 4 11:07:23 GMT 2012


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



kio/kio/slavebase.cpp
<http://git.reviewboard.kde.org/r/107520/#comment17550>

    This variable name is confusing, I think it should be renamed to something like m_timeSinceLastBatch. Anything with "time" in the name, at least.



kioslave/file/file_unix.cpp
<http://git.reviewboard.kde.org/r/107520/#comment17551>

    This assumes that QDir::setCurrent sets errno. I don't know if that's true or not, but it sounds like something that could change at any time.
    I guess the kio error code distinction doesn't matter that much, so I would remove the if and just send the generic error ERR_CANNOT_ENTER_DIRECTORY.
    Note: the call to finished() should be removed, it's redundant after error() and gives a warning. And in fact after error, we should stop there, with a "return" statement, that was missing in the original code.
    
    I guess this actually never happens in practice, for opendir() to succeed and chdir() to fail...



kioslave/file/file_unix.cpp
<http://git.reviewboard.kde.org/r/107520/#comment17552>

    Remove this comment, it is wrong here.



kioslave/file/file_unix.cpp
<http://git.reviewboard.kde.org/r/107520/#comment17553>

    Move this comment down to the details == 0 code path.


- David Faure


On Nov. 29, 2012, 11:10 p.m., Mark Gaiser wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107520/
> -----------------------------------------------------------
> 
> (Updated Nov. 29, 2012, 11:10 p.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Description
> -------
> 
> listDir is batching only in a vague manner. It required to have details set to something bigger then 0 and required to know the amount of files that where going to be send. Even then it was fixed to broadcast only the first 100 entries followed by _everything_ that comes after it. For more details, look at the diff. If you did happen to do a request with details set at 0 (thus only the filename and filetype are stored) then a different code path was taken where it wasn't even possible to batch.
> 
> I changed this to do time based batching. Now it broadcasts all the entries it currently has after 300ms have been passed. In normal situations on the local file system that means that you will never see batching. You will start to see them if you hit folders with 10.000+ entries in then (for a SSD that is). For the slower HDD drives you probably see more batching.
> 
> In the worst case scenario you could find yourself in the situation that 1 entry is broadcasted every 300ms. That is only on very slow external devices or internet places.
> 
> The advantage of batching (just repeating that here since it's currently not working in any KDE app) is that you can start showing results to the user without all the results being in. This gives the user a "feeling" that it's fast even though KIO might still be working hard to get all entries in. Dolphin is one app in particular that can really make use of this. Currently it doesn't do that. IT waits till all the results are in.
> 
> While working on this, i also updated the style of the FileProtocol::listDir function and greatly simplified how it lists the directory. Now the actual listing just follows one code path instead of one for details 0 and one for the rest.
> 
> I'd like to get this in kdelibs for KDE 4.10 because it is a bugfix even though there is no bug report.
> 
> 
> Diffs
> -----
> 
>   kio/kio/slavebase.h 0bdb146 
>   kio/kio/slavebase.cpp 8f8ff03 
>   kioslave/file/file_unix.cpp 2b47b7c 
> 
> Diff: http://git.reviewboard.kde.org/r/107520/diff/
> 
> 
> Testing
> -------
> 
> I tested this in various ways:
> (SSD) 100.000 entries in a folder with details set to 0: 1 signal with all entries
> (SSD) 100.000 entries in a folder without details set (all info): 2 or 3 signals each with between 20.000 - 50.000 entries
> (slow ftp) ftp://ftp.mirror.aarnet.edu.au/pub/archlinux/extra/os/x86_64/ results start slowly with 20 - 50 per signal and quickly climb up.
> Ran the kio test cases. Apparently i have a "failed" for kio-krununittest, a testcase that David Faure has fixed if i'm right.
> Updated the documentation to not mention the total files anymore. KioSlaves can still set it, but it's just unused for the listDir now.
> Last, running with this now and i haven't seen any issues so far.
> 
> 
> Thanks,
> 
> Mark Gaiser
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20121204/813951fe/attachment.htm>


More information about the kde-core-devel mailing list