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-106751: selectors: optimize EpollSelector.select() #106754

Merged
merged 7 commits into from Jul 18, 2023
Merged

Conversation

bdraco
Copy link
Contributor

@bdraco bdraco commented Jul 14, 2023

@bdraco bdraco changed the title gh-106751: Optimize EpollSelector performance gh-106751: Reduce EpollSelector overhead by moving code outside of the loop and avoiding a call to max() Jul 14, 2023
@bdraco bdraco marked this pull request as ready for review July 14, 2023 21:12
Lib/selectors.py Outdated Show resolved Hide resolved
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Lib/selectors.py Outdated Show resolved Hide resolved
Lib/selectors.py Outdated Show resolved Hide resolved
Copy link
Contributor

@eendebakpt eendebakpt left a comment

Choose a reason for hiding this comment

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

The changes look good to me. It took a bit of time for me to understand how the operation of and on integers is used in the event processing. The readability of that part of the code is not great. But it is not worse than before, so I am fine with the changes as is.

Lib/selectors.py Outdated Show resolved Hide resolved
@methane methane changed the title gh-106751: Reduce EpollSelector overhead by moving code outside of the loop and avoiding a call to max() gh-106751: selectors: optimize EpollSelector.select() Jul 18, 2023
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
@methane
Copy link
Member

methane commented Jul 18, 2023

Would you do some micro benchmark?

@methane
Copy link
Member

methane commented Jul 18, 2023

I missed your benchmark result in the issue.

@methane methane enabled auto-merge (squash) July 18, 2023 09:36
@methane methane merged commit aecf6ac into python:main Jul 18, 2023
22 checks passed
@bdraco
Copy link
Contributor Author

bdraco commented Jul 18, 2023

Thanks!

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.

None yet

4 participants