meven marked 2 inline comments as done.
meven added inline comments.

INLINE COMMENTS

> file_unix.cpp:58
> +// Defaults to 5MB so the user can follow copy progress
> +#define SENDFILE_CHUNK_SIZE (5 * 1024 * 1024)
>  #endif

I have reduced the value to 5 MB so that users can still follow progress, 
otherwise the progress bar would move every 2,147,479,552 bytes copied.
This value is quite arbitrary. I suspect I should use a lower value.

The best value we could have depends on the actual speed of the drive we are 
writing to, so we can have regular user feedback and maximum speed.
We would need an adaptative value, so that the chunk size would match our 
desired progress report frequency, for instance each half second.
An algorithm could be:
Start with a low chunk value size.
Compute speed = copied bytes/second obtained, if chunk < speed, double chunk 
size.
If chunk > speed, decrease a little chunk.

In the meantime this patch should help things already.
I may work on such an algorithm and implementation.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D25079

To: meven, dfaure, #frameworks, davidedmundson
Cc: ahmadsamir, sitter, apol, kde-frameworks-devel, LeGast00n, GB_2, michaelh, 
ngraham, bruns

Reply via email to