Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: About the speed

$
0
0
HOW TO SPEED UP 3X:

in file SftpFileStream.cs is predefined too small buffer - 4096 bytes is not enought.

ORIGINAL:
_
    internal SftpFileStream(SftpSession session, string path, FileMode mode)
        : this(session, path, mode, FileAccess.ReadWrite, __4096__, false)
    {
        // Nothing to do here.
    }

    internal SftpFileStream(SftpSession session, string path, FileMode mode, FileAccess access)
        : this(session, path, mode, access,__4096__, false)
    {
        // Nothing to do here.
    }_
Change it to bigger, min 65536 or up.

you also have to change buffer size check, to go thru
_
  internal SftpFileStream(SftpSession session, string path, FileMode mode, FileAccess access, int bufferSize, bool          useAsync)

  if (bufferSize <= 0 || bufferSize > __16__ * 1024)
        {
            throw new ArgumentOutOfRangeException("bufferSize");
        }_
It will speed up 3x, but it still about 3x slower than others (I compare to winscp).
It is difficult go deeper.

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>