Is uvloop still outperforming asyncio’s event loop in Python 3.13?

0
146
Asked By TechyTurtle23 On

Hey everyone! I've been working on a pretty intensive async script that relies heavily on networking and I/O operations. Up until now, I've been using uvloop for its supposed performance benefits. However, with the arrival of Python 3.13 and its improved support for free threading across many libraries, I find myself held back by uvloop since it hasn't been updated since October 2024. I'm considering switching back to asyncio's event loop. Has anyone tested whether uvloop is still faster than asyncio with Python 3.13? If so, how significant is the speed difference?

5 Answers

Answered By PythonPerformancePro On

In my recent tests with Python 3.13.0, uvloop showed about 15% better performance when using the Litestar framework with the -uvloop option compared to the default asyncio. If you're heavily network-oriented like I am, it's worth considering.

Answered By AsyncWhiz On

I think uvloop is going to stay significantly faster. The default asyncio loops are still mostly in pure Python, and there's no ongoing effort to change that. If you’re looking for faster performance, you really need a loop implemented as a native extension like uvloop.

Answered By FrameworkExplorer On

Has anyone checked out the performance of Granian with the latest Python versions? I'm curious if it competes with uvloop.

Answered By CodeCommentator On

Since you mention working on a networking-heavy async script, just a heads up: Python does handle I/O workloads pretty well, especially with async frameworks like FastAPI. It's not all bad!

DataNinja -

Exactly! Many web servers are fully async if they use frameworks like FastAPI, which are super popular for a reason.

Answered By QuickTestGuru On

I did some testing a couple of weeks ago and found that using uvicorn with uvloop was noticeably faster, with around 20-40ms speedups on endpoints that usually take 1-2 seconds. It wasn't a huge difference, but I didn't mind sticking with it since there was no cost to use it.

SpeedyCoder99 -

True, but if your response times are already 1-2 seconds, you've got bigger issues to deal with regarding optimization.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.