Skip to content

Conversation

@bdraco
Copy link
Contributor

@bdraco bdraco commented Aug 31, 2023

asyncio.wait_for creates another tasks which leads to some race conditions in cancelation and a performance hit

cpython 3.12 will change the underlying implementation of asyncio.wait_for to use asyncio.wait but that is still a long way off for many people:

python/cpython#98518

seen on profile courtesy of @Madelena

wait_for

bdraco added 2 commits August 31, 2023 09:04
`asyncio.wait_for` creates another tasks which leads to some race conditions in cancelation and a performance hit

cpython 3.12 will change the underlying implementation of `asyncio.wait_for` to use `asyncio.wait` but that is still a long way off for many people:

python/cpython#98518
@bdraco bdraco marked this pull request as ready for review August 31, 2023 13:14
@bdraco
Copy link
Contributor Author

bdraco commented Aug 31, 2023

I don't have an androidtv device though so I can't test this. I'm fixing this as a result of investigating a sluggish Home Assistant instance from the provided profile data above.

@JeffLIrion
Copy link
Owner

Thanks! I made the same change in adb-shell: JeffLIrion/adb_shell#222

@JeffLIrion JeffLIrion merged commit a7b1e51 into JeffLIrion:master Sep 1, 2023
@bdraco bdraco deleted the wait_for branch September 1, 2023 18:13
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.

2 participants