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 performance.
Installation
uvloop requires Python 3.5 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())
Alternatively, you can create an instance of the loop manually, using:
loop = uvloop.new_event_loop()
asyncio.set_event_loop(loop)
Development of uvloop
To build uvloop, you’ll need Cython and Python 3.5. The best way is to create a virtual env, so that you’ll have cython and python commands pointing to the correct tools.
git clone --recursive git@github.com:MagicStack/uvloop.git
cd uvloop
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.8.0.tar.gz
.
File metadata
- Download URL: uvloop-0.8.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c22f1f0b6e00e99f5ee635993e5f26418e740bd26f1214cf78c70f237eec06b |
|
MD5 | 279163a7b8f39dc15007cf76e3a92c02 |
|
BLAKE2b-256 | 30d43a85abecaea42c1ca4d2a23c62fe2b94017370c99abec38f6d70b38d0e9f |
File details
Details for the file uvloop-0.8.0-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c941e9667d1e2b8db2a439f8323eea36250977998e6206e7c8a728ad2a6a49 |
|
MD5 | 4d0504eef9c16e5f39f28500dbfc00b2 |
|
BLAKE2b-256 | ef86ac39a4cf959edc56fee1c97196c1f90c26d6a38d6b1658543e1328598a04 |
File details
Details for the file uvloop-0.8.0-cp36-cp36m-manylinux1_i686.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp36-cp36m-manylinux1_i686.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e6dc8f4610d0b49fad5f1def73d120233bf90cb8d83c934f5fc202a16239624 |
|
MD5 | d636663093c8d5e4905d89cb117ac254 |
|
BLAKE2b-256 | 46740a15432f5340f52b07ba184e375c2030b28e2909f48e98e7c16a28999f16 |
File details
Details for the file uvloop-0.8.0-cp36-cp36m-macosx_10_11_x86_64.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp36-cp36m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.6m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c55a97b917bda91a379b44158a23d8c9c477845cd3c24438702f22fbc3aca13 |
|
MD5 | dafaff1ef33502125c82b550c37b0b44 |
|
BLAKE2b-256 | bd2b4ae2c73163616e6bdc8df5375eccefaf3823e24e34777b964d32a524c616 |
File details
Details for the file uvloop-0.8.0-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a32f462556b57d590d1d9ec47b16ccdd77ac5d03c17479ff9ceeeafd378abf4 |
|
MD5 | 8eb5badfcf8fab649e430d788b826882 |
|
BLAKE2b-256 | 1576c78b34d3852afe41ff9c7554477509853e7a7890348b296f65bc0987a2b3 |
File details
Details for the file uvloop-0.8.0-cp35-cp35m-manylinux1_i686.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp35-cp35m-manylinux1_i686.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ebd679895f470c741f91a00228393385b18f6bff9c27347764254082d36245 |
|
MD5 | 15865bc9ab6792e4e9a1896191115429 |
|
BLAKE2b-256 | 461c51cf5ffb841dd00715853488f022cc82400d6cf53d2424ae4a0a4664ff92 |
File details
Details for the file uvloop-0.8.0-cp35-cp35m-macosx_10_11_x86_64.whl
.
File metadata
- Download URL: uvloop-0.8.0-cp35-cp35m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.5m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281b21e98c8bcd9c64aa1d0ca7768e52914f32d526c540d07744b9b5bcb9203a |
|
MD5 | 9c9f6aebf5ca0aebb467feca2908f6bc |
|
BLAKE2b-256 | 34aee37b3677de592436287c03536b8505e7653e90dec54b5ddce3f84309dedf |