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.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m

uvloop-0.10.2-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.2-cp35-cp35m-manylinux1_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

uvloop-0.10.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for uvloop-0.10.2.tar.gz
Algorithm Hash digest
SHA256 b7dc00fe9d0a04365d4c98f40316c8913463dc5b57ab64f23282d2e1d5c2defe
MD5 b583af61afa8e53e6af0c5877eef3ff6
BLAKE2b-256 34ee624682b83e8b5910ac0b1135f18944ffd8cb82354f3c481cc523f9d6b627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 927303f5280139d2d7ff844f1cb8fd075c61aeed19612bdebcc8614e7d1de461
MD5 f2890c2dfdd2f1d6b996cd7f4638861f
BLAKE2b-256 6f4b0cee34565a00374f3df7602898f7cc8508898498f94d234a7d9cfbed11d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4db78a001f0e5476f505479f11456c5bb91898d4364527185ef36542d9214321
MD5 67b7dda55f0f3e504d5e181a4c48d299
BLAKE2b-256 f8afbbace74751c1a4bed9ec23771c2d88524cb7be69970e7b060b9e60fc5949

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 5a9e0b8eb6dc7a043d21f3f612d2497d639481ad71503447cf36c2f579faa850
MD5 06477108c8706f5c37d41865ede81741
BLAKE2b-256 342edd40c786231420deb9bc9ddb2ed1dbc66c88ffe229b6515c5735e230a965

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 db47ce5f467d8e471112a4c325417b3ec1e89253582defa664f4517069b151fa
MD5 6d121fbf72f73c4099a2ba5b73d051f6
BLAKE2b-256 8b13e810cdd51bc4027499698cdf88783f9ce85d41ec2765652191033acfd95c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d248e93f99b43d58812abb579ea16b4382a282a2a5d010422b4af8e29105459d
MD5 524dfe68f0087063048b3a7554320af7
BLAKE2b-256 2b8c993db9a1575d2ea06f031ce771e5a1214a54687032eb74723ee0341686f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.10.2-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 acf4cf13267a7b3a25d7c667f527abf98e0c9d10bd87d7260690acecfa86a2e5
MD5 902468fea2df5fdf2ddab8282057bbd0
BLAKE2b-256 616c1d00866fabc7ad430a708f8ca8513e5f44c3305d4ecc922b24ac75a088fe

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