Is uvloop still faster than built-in asyncio event loop?

If so, why hasn’t the standard asyncio event loop switched to use it?

I’m considering using it, but am suspicious of it magically being faster with no other tradeoffs or concerns. Sounds too good to be true.

Put another way, as an application author, should I use uvloop for performance reasons?

The ecosystem is full of examples like this - orjson is much faster than the json module, structlog can be configured to be much faster than logging, etc. Not everything needs to be in the standard library, where it incurs a maintenance burden on the core devs.

2 Likes

Python is designed with extensibility in mind! If you’re aiming for better performance, consider using uvloop, an ultra-fast event loop for asyncio. For additional performance-focused tools, explore libraries like simdjson and similar options.

I agree with the responses here. I guess I’m hoping for more confirmation regarding uvloop specifically.

I guess I thought that switching the event loop implementation to uvloop wouldn’t be a breaking change (since it’s a “drop in replacement”). I hadn’t considered that, just because it’s API is identical doesn’t mean it is not a maintenance burden

My experience with uvloop has always been great, so I encourage you to try it and see if it’s faster for your use case (almost certainly will be).

1 Like

Does the fact that both PEP 492 and uvloop have the same author reassure you?

2 Likes

Yes it does, thank you for pointing that out

1 Like