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

Optimize Import Time by Deferring SSL Context Initialization #101

Closed
wants to merge 1 commit into from

Conversation

dosine-staging[bot]
Copy link

@dosine-staging dosine-staging bot commented Sep 2, 2024

This PR addresses the issue of increased import time caused by the changes in psf#6667. The expensive load_verify_locations() function call, which was previously executed at import time, has been deferred to run only when needed. This change ensures that the SSL context is initialized lazily, thereby optimizing the import time.

Changes:

  • Moved the SSL context initialization into a new function _get_preloaded_ssl_context().
  • Updated references to use the new function, ensuring the SSL context is only created when required.

@SamStenner SamStenner closed this Sep 2, 2024
@SamStenner SamStenner deleted the cosine/fix/import-time-increase branch September 2, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant