[kio] [Bug 291835] KIO very slow when copying from network through smb

Mark bugzilla_noreply at kde.org
Fri Dec 23 14:29:11 GMT 2016


https://bugs.kde.org/show_bug.cgi?id=291835

--- Comment #41 from Mark <markg85 at gmail.com> ---
Hmm, i have a new idea for this.

The biggest issue we have here is buffer management and finding the right
buffer size that satisfies everyone. That is impossible because everyone
(obviously) has a different setup so a perfect buffer size for me might be
horrible for others.

So.. Lets not do that anymore. Let the operating system itself decide that
(Linux in this case). Linux has two functions for that. Sendfile [1] and splice
[2].

Both work about the same. One is newer then the other, and one does copy, the
other does not (or should not). Lets ignore the details there for a moment.

Samba internally uses sendfile if it was enabled, but in my experience even
that works dreadfully slow so if we can bypass that, that would be great! And i
think we can.

smbc_open returns a file descriptor and we have (or can get if we need to) a
file descriptor for the file we want to write into or read from. So we have all
the basics that are needed for sendfile/splice to do whatever it thinks is
best. Buffer management is then done by those functions internally and we quite
simply can ignore that.

This is hypothetical! I don't know if it would actually work this way. I have a
local client/server test piece (totally unrelated to samba) that uses splice
(and sendfile optionally) and gets close to maxing out my network connection.
Say ~92% and that is consistently.

If this were to work than the issues described in this long standing bug report
are quite likely gone. kio_smb_file.cpp is probably the file that would have to
change a lot to make this work. Anyone up for it? Just as a proof of concept to
see if this idea actually works.


[1] https://linux.die.net/man/2/sendfile
[2] https://linux.die.net/man/2/splice

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list