uvloop-snapshot is a public snapshot build of MagicStack/uvloop commit e8efea407c783b0d9ad6993cfe1e3a56d1b1dc2e. It is not an official MagicStack release. The Python package and public API remain uvloop, so applications continue to use import uvloop.
Do not install uvloop-snapshot and the official uvloop distribution in the same environment. Both distributions provide the same uvloop import package and their installed files conflict.
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-snapshot requires Python 3.10 through 3.14 and is available on PyPI. Use pip to install it:
$ pip install uvloop-snapshot
Note that it is highly recommended to upgrade pip before installing uvloop with:
$ pip install -U pip
Using uvloop
As of uvloop 0.18, the preferred way of using it is via the uvloop.run() helper function:
import uvloop
async def main():
# Main entry-point.
...
uvloop.run(main())
uvloop.run() works by simply configuring asyncio.run() to use uvloop, passing all of the arguments to it, such as debug, e.g. uvloop.run(main(), debug=True).
With Python 3.11 and earlier the following alternative snippet can be used:
import asyncio
import sys
import uvloop
async def main():
# Main entry-point.
...
if sys.version_info >= (3, 11):
with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
runner.run(main())
else:
uvloop.install()
asyncio.run(main())
Building From Source
To build this uvloop snapshot, you’ll need Python 3.10 or greater:
Clone the repository:
$ git clone --recursive git@github.com:MagicStack/uvloop.git $ cd uvloopCreate a virtual environment and activate it:
$ python3 -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-snapshot 0.22.1.post1
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_snapshot-0.22.1.post1.tar.gz | 2.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| uvloop_snapshot-0.22.1.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.17+ x86-64 | Details |
| uvloop_snapshot-0.22.1.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
| uvloop_snapshot-0.22.1.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| uvloop_snapshot-0.22.1.post1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| uvloop_snapshot-0.22.1.post1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 22.2 MB
Release files / uvloop_snapshot-0.22.1.post1.tar.gz
| Download URL | uvloop_snapshot-0.22.1.post1.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
404b773238650eb995cbfe0dfd56264b2c4f1cbe7bee2d58ef22e8bba9653ed2
|
|
BLAKE2b-256 checksum How to use checksums |
368b11d0dad4a7813c02d40aa12dfd0db833c0b8016a89b45f13b57cc56de683
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / uvloop_snapshot-0.22.1.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uvloop_snapshot-0.22.1.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
32c09fee72b1aa67cff2bef67652c17698aca27b633bfbf0f25e12652a4d70da
|
|
BLAKE2b-256 checksum How to use checksums |
7350582a11fdc3c90e4f3bc26e26e16a8e8a7b5c90a32719583ddd6f2a8fb4be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / uvloop_snapshot-0.22.1.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uvloop_snapshot-0.22.1.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
35286a64c1017256cfa44d15e24007f7e3e8cb8e5e6ae7863ce7a9e32bcbb424
|
|
BLAKE2b-256 checksum How to use checksums |
756cfabd5f54839378ee3759f2694592964cc7c8dba8752aff2b23e18c56eed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / uvloop_snapshot-0.22.1.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uvloop_snapshot-0.22.1.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
3a34883f6101b5682fccf36c96300239511ffb6f2177ddcf3ce0de42e273b8fb
|
|
BLAKE2b-256 checksum How to use checksums |
aafe0664e03f21749e166fb1bf991305f52a0ab34b993a30d56758cb6fad8ac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / uvloop_snapshot-0.22.1.post1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uvloop_snapshot-0.22.1.post1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
a19076bebbffaae455bc9c3155233b2863dc903ee64086ff0aa9fef52cf111fa
|
|
BLAKE2b-256 checksum How to use checksums |
579ed4bcd6ba6706f3ad8b4287ef4953fe79bb0ac4fc3a67df7d51ae2e821e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / uvloop_snapshot-0.22.1.post1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uvloop_snapshot-0.22.1.post1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
90fa4d2dff098f55947d83d806c9227c3dc8f1f135f716f03190ce1c9687a8ff
|
|
BLAKE2b-256 checksum How to use checksums |
ea8426e3f3965dea12b2336293651d575cb0073365e4e4d26e110195e83b236d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|