Fast implementation of asyncio event loop on top of libuv
Project description
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.5 or greater and is available on PyPI. Use pip to install it:
$ pip install uvloop
Using uvloop
To make asyncio use uvloop, you can install the uvloop event loop policy:
import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
or, starting with uvloop 0.12:
import uvloop
uvloop.install()
Building From Source
To build uvloop, you’ll need Python 3.5 or greater:
Clone the repository:
$ git clone --recursive git@github.com:MagicStack/uvloop.git $ cd uvloop
Create a virtual environment and activate it:
$ python3.7 -m venv uvloop-dev $ source uvloop-dev/bin/activate
Install development dependencies:
$ pip install -r requirements.dev.txt
Build and run tests:
$ make $ make test
License
uvloop is dual-licensed under MIT and Apache 2.0 licenses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file uvloop-0.13.0.tar.gz
.
File metadata
- Download URL: uvloop-0.13.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942cd07035510b149d6160796f4e972137130ae953871b6a98c2cf5d5ab68c2e |
|
MD5 | 11c84a0a62048200a70272ec9a990ff9 |
|
BLAKE2b-256 | e315dc3276384f4363015d7c72282f37066bae26c77f99158f66c9058ac167cf |
File details
Details for the file uvloop-0.13.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e698a20a3b4ccb380d207f9d491d4085d7c38d364f6a0bae98684a1612a9607a |
|
MD5 | bf50aa5e422c866b5d09fc7c7df863d4 |
|
BLAKE2b-256 | bb2783c42973ae0a27340c32170fa261f1692319371df1fb3bf054a00dd52d7c |
File details
Details for the file uvloop-0.13.0-cp37-cp37m-macosx_10_11_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp37-cp37m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.7m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 155b34d513655e753d07f499a7e811970e2d397f240dfcbec0b32a9587159c99 |
|
MD5 | 433750be77c2c2f761ebeffde660fe0e |
|
BLAKE2b-256 | 1498b17a324ee8dd177be90cc47267838e428e9ac7e0db7f81364b6b27ce0f4b |
File details
Details for the file uvloop-0.13.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0deb6c97c5807c792dd9024bab90e6ca49e981862103cb2ea37b430c1ca0a267 |
|
MD5 | 2528727fec5bba8cfc74da35f1607d01 |
|
BLAKE2b-256 | 043d7225a411742e6e7583f630525b140bb4eab2d3731453f22096c5e75f5b59 |
File details
Details for the file uvloop-0.13.0-cp36-cp36m-macosx_10_11_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp36-cp36m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.6m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c63b6c0bf33144c604dd72f7eecf2d3a3ac7405c503c67bd98128cf306efe18a |
|
MD5 | 624baa093a727831caf9fbd8db664b81 |
|
BLAKE2b-256 | 858ebe499add791bd48ce153b315f9e0ce3d03c785bdf4cc664af8092adaeb29 |
File details
Details for the file uvloop-0.13.0-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1df3ddfa280206e9999ae1c777a20836eb895bcec6dc9fae2cbb6eecfafb099e |
|
MD5 | b40f03e69d4111821ac326bce1c095a2 |
|
BLAKE2b-256 | 2e4c1971070b3fa83df7872e2b6dd1033e6c637bd38d4b6fc3b7892b2ecfb3f4 |
File details
Details for the file uvloop-0.13.0-cp35-cp35m-macosx_10_11_x86_64.whl
.
File metadata
- Download URL: uvloop-0.13.0-cp35-cp35m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.5m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b19361c8767e1dc61f6367f948d4f3dc5504b9f2eba488641b3d26ec14498ba |
|
MD5 | ad52a600f2eb92ceef20445c1bfc8d88 |
|
BLAKE2b-256 | c8a516f0937914a3aa43ab93867677fa9f8c4309566338bb27f11b7f76f06e9d |