-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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-110733: Optimize _run_once for many iterations of the event loop #110735
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch LGTM. I haven't confirmed the speedup but I agree that not calling min()
or max()
is slightly faster. It will matter even more in 3.13 when we expect to have a basic tracing JIT.
I noticed that you considered calling time()
only once -- do you want to add that to the PR? Or did you already measure it and it doesn't help?
Misc/NEWS.d/next/Library/2023-10-11-18-43-43.gh-issue-110733.UlrgVm.rst
Outdated
Show resolved
Hide resolved
I couldn't come up with a way to get it to work that wasn't a breaking change since we need the time before the |
Thanks! |
Replace
min
andmax
in_run_once
with simple<
and>
close #110733
benchmarks in #110733