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

gh-81536: For nonblocking sockets, add SSLSocket.eager_recv to call SSL_read in a loop #31492

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Dec 12, 2022

  1. bpo-37355: For nonblocking sockets, call SSL_read in a loop

    Continue looping until data is exhausted, and only then reacquire the GIL. This
    makes it possible to perform multi-threaded TLS downloads without saturating
    the GIL. On a test workload performing HTTPS download with 32 threads pinned
    to 16 cores, this produces a 4x speedup.
    
                                  before     after
        wall clock time (s)  :    29.637     7.116
        user time (s)        :     8.793    12.584
        system time (s)      :   105.118    30.010
        voluntary switches   : 1,653,065   248,484
        speed (MB/s)         :      4733     19712
    
    Original author: Josh Snyder - hashbrowncipher
    Safihre committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    8c7634a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac91ed7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f488960 View commit details
    Browse the repository at this point in the history