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-106664: selectors: add get method to _SelectorMapping #106665
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Avoids raising and catching KeyError twice
methane
changed the title
gh-106664: Reduce overhead to add new selectors
gh-106664: selectors: add get method to _SelectorMapping
Jul 12, 2023
methane
reviewed
Jul 12, 2023
methane
reviewed
Jul 12, 2023
Misc/NEWS.d/next/Library/2023-07-12-03-04-45.gh-issue-106664.ZeUG78.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
bdraco
commented
Jul 12, 2023
Misc/NEWS.d/next/Library/2023-07-12-03-04-45.gh-issue-106664.ZeUG78.rst
Outdated
Show resolved
Hide resolved
methane
reviewed
Jul 13, 2023
Misc/NEWS.d/next/Library/2023-07-12-03-04-45.gh-issue-106664.ZeUG78.rst
Outdated
Show resolved
Hide resolved
Thank you |
kgdiem
pushed a commit
to kgdiem/cpython
that referenced
this pull request
Jul 14, 2023
…hon#106665) It can be used to avoid raising and catching KeyError twice via __getitem__. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
bdraco
added a commit
to bdraco/docker-base
that referenced
this pull request
Jul 22, 2023
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
bdraco
added a commit
to bdraco/async_upnp_client
that referenced
this pull request
Aug 13, 2023
get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
StevenLooman
pushed a commit
to StevenLooman/async_upnp_client
that referenced
this pull request
Aug 13, 2023
* Implement get on CaseInsensitiveDict get was previously provided by the parent class which had to raise KeyError for missing values. Since try/except is only cheap for the non-exception case the performance was not good when the key was missing similar to python/cpython#106665 but in the HA case we call this even more frequently
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoids raising and catching KeyError twice every time a new reader is added
The overall goal is to reduce latency and time to first byte
related #106527 related #106554