asyncio.get_running_loop is one of the most performance critical functions in asyncio. With #66285 the running loop can be reset in the fork handler thereby avoiding the need for the getpid checks. The whole running loop holder object is unnecessary now and adds up unnecessary dependent memory loads.
asyncio.get_running_loop is one of the most performance critical functions in asyncio.
Do you have data about this? Does it show up in profiles of real functions, or do you have call counts or whatever? Usually I imagine the call is followed by a much more expensive computation.
kumaraditya303 commentedDec 20, 2022
•
edited
asyncio.get_running_loop
is one of the most performance critical functions inasyncio
. With #66285 the running loop can be reset in the fork handler thereby avoiding the need for thegetpid
checks. The whole running loop holder object is unnecessary now and adds up unnecessary dependent memory loads.Benchmark:
Result:
The numbers speak for themselves.
Linked PRs
asyncio.get_running_loop
#100364The text was updated successfully, but these errors were encountered: