Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce memory allocation when writing to SSLSocket
[ This is a backport to the 2.1 branch. ] At the moment OpenSSL::Buffering#do_write allocates some additional strings, and in my profiling writing 5MB of data allocates additional 7.7MB of strings. This patch greatly reduces memory allocations, and now writing 5MB of data allocates only additional 0.2MB of strings. This means that large file uploads would effectively not allocate additional memory anymore. Reference: https://bugs.ruby-lang.org/issues/14426 Reference: ruby/ruby#1924 (cherry picked from commit 251b5be)
- Loading branch information