From c0665f0a2e353b127ebdc7ed307ff441c21120a1 Mon Sep 17 00:00:00 2001 From: Niklas Paulsson Date: Mon, 11 Sep 2023 10:41:46 +0200 Subject: [PATCH] Align disk read/writes with the commonly used 4 kb block size --- lib/net/sftp/operations/download.rb | 2 +- lib/net/sftp/operations/upload.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/net/sftp/operations/download.rb b/lib/net/sftp/operations/download.rb index 54965ec..d4c27b6 100644 --- a/lib/net/sftp/operations/download.rb +++ b/lib/net/sftp/operations/download.rb @@ -218,7 +218,7 @@ def stack; @stack; end def progress; @progress; end # The default read size. - DEFAULT_READ_SIZE = 32_000 + DEFAULT_READ_SIZE = 32_768 # The number of bytes to read at a time from remote files. def read_size diff --git a/lib/net/sftp/operations/upload.rb b/lib/net/sftp/operations/upload.rb index 1e98dbf..fab1893 100644 --- a/lib/net/sftp/operations/upload.rb +++ b/lib/net/sftp/operations/upload.rb @@ -230,7 +230,7 @@ def progress; @progress; end LiveFile = Struct.new(:local, :remote, :io, :size, :handle) # The default # of bytes to read from disk at a time. - DEFAULT_READ_SIZE = 32_000 + DEFAULT_READ_SIZE = 32_768 # The number of readers to use when uploading a single file. SINGLE_FILE_READERS = 2