Skip to content

feat: set event loop to uvloop #1697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open

feat: set event loop to uvloop #1697

wants to merge 9 commits into from

Conversation

EvanR-Dev
Copy link
Contributor

@EvanR-Dev EvanR-Dev commented Jun 5, 2025

Description

https://github.com/MagicStack/uvloop

UnixSelectorEventLoop (current worker loop) vs Uvloop

Test 1: 10k reqs, 50 UVs
Unix
Total: 19.4 s total
Avg: 96.95 ms
Median: 95.45 ms
p(95): 106.34 ms
RPS: 515

Uvloop
Total: 17.7 s total
Avg: 87.99 ms
Median: 87.79 ms
p(95): 95.99 ms
RPS: 565

Test 2: Number requests in 5 minutes, 100 VUs
Unix
Total: 157,580 reqs completed
Avg: 190.35 ms
Median: 189.89 ms
p(95): 206.88 ms
RPS: 525

Uvloop
Total: 167,928 reqs completed
Avg: 178.58 ms
Median: 178.21 ms
p(95): 195.29 ms
RPS: 560

Test 3: Number requests in 5 minutes, 500 VUs, with simulated parallelism for each request (5 concurrent tasks via asyncio.gather)
Unix
Total: 216,212 reqs completed
Avg: 694.03 ms
Median: 693.09 ms
p(95): 814.89 ms
0.15% failed requests (no 200)
RPS (success only): 720

Uvloop
Total: 231,878 reqs completed
Avg: 647.01 ms
Median: 643.42 ms
p(95): 737.38 ms
0.12% failed requests (no 200)
RPS (success only): 772

Test 1 improvement: 8.76% faster
Test 2 improvement: 6.57% more reqs
Test 3 improvement: 7.24% more reqs


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@EvanR-Dev EvanR-Dev marked this pull request as ready for review June 6, 2025 19:43
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.

1 participant