Adding selectors has two KeyError exceptions in the success path #106664
Labels
performance
Performance or resource usage
topic-asyncio
type-feature
A feature request or enhancement
Similar to #106527, adding a new asyncio reader has to hit
_SelectorMapping.__getitem__
which is expected to raise and catch KeyError twice since the reader will not yet be in the map.When connections are constantly being added and removed because devices are being polled over http/websocket the overhead of adding/removing readers adds up.
For a webserver with connections constantly being added/removed, the cost of adding and removing impacts how many clients can be handled
Another place I see this come up is with dbus connections which need to get torn down and created at fast clip when dealing with bluetooth devices.
See #106527 (comment) and #106527 (comment) for where this was split from
Linked PRs
The text was updated successfully, but these errors were encountered: