Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory allocation when writing to SSLSocket #212

Merged
merged 2 commits into from
Aug 8, 2018

Commits on Aug 8, 2018

  1. openssl/buffering.rb: no RS when output

    * ext/openssl/lib/openssl/buffering.rb (do_write, puts): output
      methods should not be affected by the input record separator.
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    Sync-with-trunk: r62038
    nobu authored and rhenium committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    3f6e30e View commit details
    Browse the repository at this point in the history
  2. 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#1924
    janko authored and rhenium committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    251b5be View commit details
    Browse the repository at this point in the history