uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.
The project documentation can be found here. Please also check out the wiki.
Performance
uvloop makes asyncio 2-4x faster.
The above chart shows the performance of an echo server with different message sizes. The sockets benchmark uses loop.sock_recv() and loop.sock_sendall() methods; the streams benchmark uses asyncio high-level streams, created by the asyncio.start_server() function; and the protocol benchmark uses loop.create_server() with a simple echo protocol. Read more about uvloop in a blog post about it.
Installation
uvloop requires Python 3.7 or greater and is available on PyPI. Use pip to install it:
$ pip install uvloop
Note that it is highly recommended to upgrade pip before installing uvloop with:
$ pip install -U pip
Using uvloop
Call uvloop.install() before calling asyncio.run() or manually creating an asyncio event loop:
import asyncio
import uvloop
async def main():
# Main entry-point.
...
uvloop.install()
asyncio.run(main())
Building From Source
To build uvloop, you’ll need Python 3.7 or greater:
Clone the repository:
$ git clone --recursive git@github.com:MagicStack/uvloop.git $ cd uvloopCreate a virtual environment and activate it:
$ python3.7 -m venv uvloop-dev $ source uvloop-dev/bin/activateInstall development dependencies:
$ pip install -e .[dev]Build and run tests:
$ make $ make test
License
uvloop is dual-licensed under MIT and Apache 2.0 licenses.
Metadata
Release files for uvloop 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uvloop-0.16.0.tar.gz | 2.1 MB | Details |
Built distributions (wheels)
Total release size: 48.5 MB
Release files / uvloop-0.16.0.tar.gz
| Download URL | uvloop-0.16.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f74bc20c7b67d1c27c72601c78cf95be99d5c2cdd4514502b4f3eb0933ff1228
|
|
BLAKE2b-256 checksum How to use checksums |
abd922bbffa8f8d7e075ccdb29e8134107adfb4710feb10039f9d357db8b589c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | uvloop-0.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
772206116b9b57cd625c8a88f2413df2fcfd0b496eb188b82a43bed7af2c2ec9
|
|
BLAKE2b-256 checksum How to use checksums |
121c4c270b22f68a75bedf795aadc40370c4ff9e910a5e1aff327c24aaae6a99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | uvloop-0.16.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.10 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
bd53f7f5db562f37cd64a3af5012df8cac2c464c97e732ed556800129505bd64
|
|
BLAKE2b-256 checksum How to use checksums |
b90014dffb56943092c2b5821d288dc23ff36dff9ad3b8aad3547c71b171cf3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
30ba9dcbd0965f5c812b7c2112a1ddf60cf904c1c160f398e7eed3a6b82dcd9c
|
|
BLAKE2b-256 checksum How to use checksums |
daea56fecce56844e308b6ff3c5b55a372a6a4da2c6fe8ee35a272459f534d9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
6224f1401025b748ffecb7a6e2652b17768f30b1a6a3f7b44660e5b5b690b12d
|
|
BLAKE2b-256 checksum How to use checksums |
2a0775074f9789d5f8811bc77230a84ddbb7586e555e84f59d75d2968ef5c4a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
1e5f2e2ff51aefe6c19ee98af12b4ae61f5be456cd24396953244a30880ad861
|
|
BLAKE2b-256 checksum How to use checksums |
cbc898fa2d230835fe529e362301e5a852d0413e606ed790af9d96212086ace1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | uvloop-0.16.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
98d117332cc9e5ea8dfdc2b28b0a23f60370d02e1395f88f40d1effd2cb86c4f
|
|
BLAKE2b-256 checksum How to use checksums |
d5a4bf2554658b97ae17d0b0cc62a51b2425c4de9526a76638ab39dff12f1c05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
089b4834fd299d82d83a25e3335372f12117a7d38525217c2258e9b9f4578897
|
|
BLAKE2b-256 checksum How to use checksums |
bdccd682d7156873e080587ae1b749976ab674d490b3d43f03414707126a9a4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl
| Download URL | uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
6ccd57ae8db17d677e9e06192e9c9ec4bd2066b77790f9aa7dede2cc4008ee8f
|
|
BLAKE2b-256 checksum How to use checksums |
a2222fba0652a03bac8c38201d5832aaba8d47e6e8dd4e2d05c9746571927ebb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | uvloop-0.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e0d26fa5875d43ddbb0d9d79a447d2ace4180d9e3239788208527c4784f7cab
|
|
BLAKE2b-256 checksum How to use checksums |
89bffcd4adf745fa35bd930c4af3e374ffac3a3d0d674992e8167abe21361316
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | uvloop-0.16.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
647e481940379eebd314c00440314c81ea547aa636056f554d491e40503c8464
|
|
BLAKE2b-256 checksum How to use checksums |
7d61e7003a75c758632e2e72f4dd76e7b3580e680a0fb764e1129515f3f143c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | uvloop-0.16.0-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
bd8f42ea1ea8f4e84d265769089964ddda95eb2bb38b5cbe26712b0616c3edee
|
|
BLAKE2b-256 checksum How to use checksums |
745d8d43cca0ef537ebd4fda74519a8e3b61e799b7fa8ae938b1b23116fe3dd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl
| Download URL | uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
e814ac2c6f9daf4c36eb8e85266859f42174a4ff0d71b99405ed559257750382
|
|
BLAKE2b-256 checksum How to use checksums |
30855d96af493078e85f5b268eaba4d9670afe45f28af2933b8cb463e0586f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | uvloop-0.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
3a19828c4f15687675ea912cc28bbcb48e9bb907c801873bd1519b96b04fb805
|
|
BLAKE2b-256 checksum How to use checksums |
7e1668cfbc192b0189a950bd385288b3f566d1cc81615c4d3912623d28295fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | uvloop-0.16.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
04ff57aa137230d8cc968f03481176041ae789308b4d5079118331ab01112450
|
|
BLAKE2b-256 checksum How to use checksums |
50382a0825302b207ff694cb501f7868330d004eeb6ee70470c52c00c2d4e6d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / uvloop-0.16.0-cp37-cp37m-macosx_10_9_x86_64.whl
| Download URL | uvloop-0.16.0-cp37-cp37m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
b572256409f194521a9895aef274cea88731d14732343da3ecdb175228881638
|
|
BLAKE2b-256 checksum How to use checksums |
192787739cae95fea0ebcd65f1ea3d2925cb290582cb7fcd5d7456ee865a720a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|