From 17969a9a67ae8db7dbc227a8afbb220b94d08e7f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 22 Dec 2022 09:02:10 +0000 Subject: standardize on 16384-byte reads This is the size used by Ruby internally for IO.copy_stream. 8192 seems too small nowadays with the higher cost of syscalls. --- lib/yahns/http_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/yahns/http_client.rb') diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb index b6b6035..826eb8d 100644 --- a/lib/yahns/http_client.rb +++ b/lib/yahns/http_client.rb @@ -315,7 +315,7 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc: end def do_pread(io, count, offset) - count = 0x4000 if count > 0x4000 + count = 16384 if count > 16384 buf = Thread.current[:yahns_sfbuf] ||= ''.dup if io.respond_to?(:pread) io.pread(count, offset, buf) -- cgit v1.2.3-24-ge0c7