Skip to main content

Fast implementation of asyncio event loop on top of libuv

Project description

https://travis-ci.org/MagicStack/uvloop.svg?branch=master https://img.shields.io/pypi/v/uvloop.svg

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.

performance.png

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 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())

Building From Source

To build uvloop, you’ll need Python 3.5 or greater:

  1. Clone the repository:

    $ git clone --recursive git@github.com:MagicStack/uvloop.git
    $ cd uvloop
  2. Create a virtual environment and activate it, for example:

    $ python3.7 -m venv uvloop-dev
    $ source uvloop-dev/bin/activate
  3. Install development dependencies:

    $ pip install -r requirements.dev.txt
  4. 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

uvloop-0.11.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

uvloop-0.11.0-cp37-cp37m-manylinux1_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.7m

uvloop-0.11.0-cp37-cp37m-manylinux1_i686.whl (3.5 MB view details)

Uploaded CPython 3.7m

uvloop-0.11.0-cp37-cp37m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m macOS 10.11+ x86-64

uvloop-0.11.0-cp36-cp36m-manylinux1_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.6m

uvloop-0.11.0-cp36-cp36m-manylinux1_i686.whl (3.5 MB view details)

Uploaded CPython 3.6m

uvloop-0.11.0-cp36-cp36m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6m macOS 10.11+ x86-64

uvloop-0.11.0-cp35-cp35m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.5m

uvloop-0.11.0-cp35-cp35m-manylinux1_i686.whl (3.4 MB view details)

Uploaded CPython 3.5m

uvloop-0.11.0-cp35-cp35m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

File details

Details for the file uvloop-0.11.0.tar.gz.

File metadata

  • Download URL: uvloop-0.11.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uvloop-0.11.0.tar.gz
Algorithm Hash digest
SHA256 34138af5f6ced8f2f2ba39b487119988f5055245223a330de71957c8a6713b84
MD5 0f9a9caee64d2d83f75fd58653b9c7ba
BLAKE2b-256 cde51492d3a6ee52f261df764eece684513bb8abbe988d4bd3d94093f39e2bea

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5336c76cd5a984b3d614170fe7a90f8cbda69eae2d9b69f00439afad86841cfd
MD5 c9188481da46b45ddcea7e2594b1a511
BLAKE2b-256 e982e3ffdaa3aa271e4572c5aef84534765f1fd44c60f106acae240cb1df03ec

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp37-cp37m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a23ab4551f9e28fea66bebc1851e6834daa25ab708c3c86c3cbab0f93fb337cb
MD5 a046f22fba7581f042cd8bf8c0e7b906
BLAKE2b-256 3869cfed187153aaf6a9b0405701bf865d15f0f957c332865c63a33b557216cd

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp37-cp37m-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 66268d184b37b1b6952dfa912b46baee41f23b51235665c7c0c01871ee893db4
MD5 90768fe2bf787286d6a65413bc32360f
BLAKE2b-256 645c610353aedb1e43caa764b3ed68c8015c41f11b73c1500cdb7a5f5582a0ff

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b53401e3f77ff3828cf8e6bdc4155b18d6106ea56c8a338eb90de5e40373e18e
MD5 262f15662561c5a2df017fea80e0382b
BLAKE2b-256 bad2ad569204788edb557a97577ae56523b20203c5ec5d628941d6819580e75b

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d43830035386a5605e5ce385b75651170f2c821aa9ad7566794ac21814e4e367
MD5 e44a94a47b989848e41badb7e469c929
BLAKE2b-256 0d541a749d87e23561c536c2976e6f7dd89e33053206a0c5119620b020a5e628

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp36-cp36m-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 9803fe492b5776e2a3a256dc43f14e14627f549614c6d791acd5f1f599a33599
MD5 0ec4d1459ea568831435e5fa7798dc85
BLAKE2b-256 76c875fcc8e36c48697d8787633da06d568367f4911ac20175538078242da5ad

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dbc7158699e20eadcce6d6bcfcfc4541e557557c839217b79cc25e6d5a0d072a
MD5 f668b64926b7462578b9a79d2474898f
BLAKE2b-256 df414299791a3f894aa061eac375d56fbeb7435b9a6d8c638edd4bed53b331e0

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ea31e75620c63d5507cc3c0bbe9646e6d8fea81f93c643ba631f2ab7d84d1f60
MD5 a49e8d0c323e1d91c3ea7fb6948ac92d
BLAKE2b-256 83d9058c1b63137377dc95ccacdf98a194366cf7a4e60b932a74bbdf8b9c7c3b

See more details on using hashes here.

File details

Details for the file uvloop-0.11.0-cp35-cp35m-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.11.0-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 edfd7e24cf8b68d6d4228066251c91884bb142b4ed62e6189602f50c44240d90
MD5 35a4793fd7e409ba30e123aedc212e27
BLAKE2b-256 0895ab854f4579cceb3c2443ec5f50f9e8a2736e792b5b0e80cf9c0b5cb998dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page