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://ci.appveyor.com/api/projects/status/4apd79e5jqrwwe40/branch/master?svg=true 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.10.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

uvloop-0.10.1-cp36-cp36m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.6m

uvloop-0.10.1-cp36-cp36m-manylinux1_i686.whl (3.4 MB view details)

Uploaded CPython 3.6m

uvloop-0.10.1-cp36-cp36m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m macOS 10.11+ x86-64

uvloop-0.10.1-cp35-cp35m-manylinux1_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.5m

uvloop-0.10.1-cp35-cp35m-manylinux1_i686.whl (3.3 MB view details)

Uploaded CPython 3.5m

uvloop-0.10.1-cp35-cp35m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.10.1.tar.gz
Algorithm Hash digest
SHA256 90f9d3ba56ddd554954feff381306ec7e8c31305fc8bf686277b7d8c46e09d68
MD5 8bc0b8b60b9cedaee7d5ae8bf352889b
BLAKE2b-256 d450385f5dfd008508750a255ae742aaea6cc7f58877d9444b2d759543b0ee72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2d4aaae6e3b35416a82b52f7d41d7d366c8870627a923262e0654ab95e0a37da
MD5 ea457f60929600cf7c0deaa6e2664a93
BLAKE2b-256 dc7f9b3fb733bcccb35a22f476ec01784cd37a90b2536c38e8d605a6bb91240a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 3286e803eeb55413b4f1ef38f43a40340c490d3b7b1427ff2e50bacff7ee95a3
MD5 21e86793ea7715401b7294bcc7fc0195
BLAKE2b-256 74c86d8d002fb13e02288811276d30ab160067c3f73555e1acaa25bd11fe8d98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 8b4c009b5cd8b2270bdccff288f6d162526bc80dc7fd142592f1761441ffc229
MD5 b469d78f0c6c2ff1c3003f634b55816e
BLAKE2b-256 c2fcbea04553f7fb73155ccf392d6208a9ba3b342d66588c10c3886c58b100b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5aade4aa1f5508ca1aa26cd01ebaf1d638d06c9a326f78755643c4bcafff17a7
MD5 ffbf593bddb7acab2247a90de88e7f27
BLAKE2b-256 bcdaba48c882284f64903c0320a9515f42187bda5afc0d84cd7976b130677e68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f95fc54b281c87021ed931cdc18c6e5983bbd16b0369038354bef5210173d5f1
MD5 2d23d7a1ad4a5feb0b761082bcc99ee3
BLAKE2b-256 e61cee3914b0fa06b4dff0a4d3fc488f5caddf0c8f56402c46009c4a9091ea45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.1-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 6fbcd4f5515d4a07da471261e75d30b7a6af3025413edd1bf68e56835534d32e
MD5 ff5e10afef040108640220d5662cb752
BLAKE2b-256 1e8da4ab0037075c494c434c23ed40674532dd22ccf897dbc632d17324a9f5d0

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