Commit 251b5be
Reduce memory allocation when writing to SSLSocket
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#19241 parent 3f6e30e commit 251b5be
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 319 | + | |
| 320 | + | |
324 | 321 | | |
325 | | - | |
| 322 | + | |
326 | 323 | | |
327 | 324 | | |
328 | 325 | | |
329 | | - | |
330 | | - | |
| 326 | + | |
331 | 327 | | |
332 | | - | |
333 | 328 | | |
334 | 329 | | |
335 | 330 | | |
| |||
0 commit comments