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

[3.11] gh-91539: improve performance of get_proxies_environment (GH-91566) #97918

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 5, 2022

  • improve performance of get_proxies_environment when there are many environment variables

  • 📜🤖 Added by blurb_it.

  • fix case of short env name

  • fix formatting

  • fix whitespace

  • whitespace

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

  • whitespace

  • Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst

Co-authored-by: Carl Meyer carl@oddbird.net

  • Update Lib/urllib/request.py

Co-authored-by: Carl Meyer carl@oddbird.net

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer carl@oddbird.net
(cherry picked from commit aeb28f5)

Co-authored-by: Pieter Eendebak pieter.eendebak@gmail.com

…nGH-91566)

* improve performance of get_proxies_environment when there are many environment variables

* 📜🤖 Added by blurb_it.

* fix case of short env name

* fix formatting

* fix whitespace

* whitespace

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

* whitespace

* Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst

Co-authored-by: Carl Meyer <carl@oddbird.net>

* Update Lib/urllib/request.py

Co-authored-by: Carl Meyer <carl@oddbird.net>

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
(cherry picked from commit aeb28f5)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miss-islington
Copy link
Contributor Author

Sorry, I can't merge this PR. Reason: Head branch was modified. Review and try the merge again..

@ambv
Copy link
Contributor

ambv commented Oct 5, 2022

This is a perf optimization, currently we're accepting changes for 3.11.1+ which are bug fixes only. Therefore, this change cannot be included in 3.11.

@ambv ambv closed this Oct 5, 2022
@miss-islington miss-islington deleted the backport-aeb28f5-3.11 branch October 5, 2022 22:46
@FrederikP
Copy link

I was wondering whether this will be merged at some point? It seems to be included in latest python 3.10 but not latest 3.11, if I saw it correctly.
Thanks

@morotti
Copy link
Contributor

morotti commented Jul 19, 2024

so sad this fix was merged in master and merged in 3.10 but the merged in 3.11 was blocked for no reason :( :( :(

requests is using this urllib get_proxies_environment function to get proxy settings on every HTTP request.
when you install packages with pip install xxx, about 5% of the run time is just fetching proxy settings again and again through this function.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants