You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm investigating ways to improve pip's startup time. Obviously importing a HTTP library like requests is going to be slow regardless of we do, but the deferring the SSLContext pre-loading until use is something would benefit pip.
pip manages its own SSLContext so it can use truststore for automatic system CA support, thus we never use _preloaded_ssl_context on Python 3.10 or higher1. Unfortunately, OpenSSL 3.x has terrible verify path/location performance: python/cpython#95031 so the unnecessary load_verify_locations() call ends up eating ~15 ms on my system.
So, would a patch deferring the context creation until use be accepted? I realize this is of limited benefit for most users since they probably aren't passing their own SSLContext, so if this is too niche, I understand!
Footnotes
Truststore requires Python 3.10 or higher. Also, pip's truststore integration can be disabled via --use-deprecated=legacy-certs but as the flag name implies, we don't really want people to be using this until necessary. ↩
The text was updated successfully, but these errors were encountered:
Hi,
So I'm investigating ways to improve pip's startup time. Obviously importing a HTTP library like requests is going to be slow regardless of we do, but the deferring the SSLContext pre-loading until use is something would benefit pip.
requests/src/requests/adapters.py
Lines 77 to 87 in fe0583b
pip manages its own SSLContext so it can use truststore for automatic system CA support, thus we never use
_preloaded_ssl_context
on Python 3.10 or higher1. Unfortunately, OpenSSL 3.x has terrible verify path/location performance: python/cpython#95031 so the unnecessaryload_verify_locations()
call ends up eating ~15 ms on my system.So, would a patch deferring the context creation until use be accepted? I realize this is of limited benefit for most users since they probably aren't passing their own SSLContext, so if this is too niche, I understand!
Footnotes
Truststore requires Python 3.10 or higher. Also, pip's truststore integration can be disabled via
--use-deprecated=legacy-certs
but as the flag name implies, we don't really want people to be using this until necessary. ↩The text was updated successfully, but these errors were encountered: