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 PyPI - Downloads

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 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:

  1. Clone the repository:

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

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

Uploaded Source

Built Distributions

uvloop-0.12.0-cp37-cp37m-manylinux1_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.7m

uvloop-0.12.0-cp37-cp37m-manylinux1_i686.whl (3.3 MB view details)

Uploaded CPython 3.7m

uvloop-0.12.0-cp37-cp37m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m macOS 10.11+ x86-64

uvloop-0.12.0-cp36-cp36m-manylinux1_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.6m

uvloop-0.12.0-cp36-cp36m-manylinux1_i686.whl (3.3 MB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.11+ x86-64

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

Uploaded CPython 3.5m

uvloop-0.12.0-cp35-cp35m-manylinux1_i686.whl (3.2 MB view details)

Uploaded CPython 3.5m

uvloop-0.12.0-cp35-cp35m-macosx_10_11_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

File details

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

File metadata

  • Download URL: uvloop-0.12.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0.tar.gz
Algorithm Hash digest
SHA256 afdf34bf507090e4c7f5108a17240982760356b8aae4edd37180ec4f94c36cbb
MD5 3f57bccd1b37de92cb4a432415f9704e
BLAKE2b-256 f05acf8cb64bdc694462ef1ee9a925302dac40b29a52ab0eede4bab7fc0e0f2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7639188ff4466d86cfd4418cd784d1198a8cc913279fb8798a4b12a4d42ad341
MD5 9985182840a558349a2d21fd2720d321
BLAKE2b-256 1da9dc86e8dedba5adf4cef3da63544f7fd6d42a3f86534268ef2f8cab89ac5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0ff2e67b693f7d2007466952dbe312075098e8f15364fda27d16e8a7f266d74d
MD5 cac69d71449b5f78f323ac515aac9b27
BLAKE2b-256 0e9b0d9e6834d8d4b46a81409da3f6d486c2e503f0faed5f332a7a44759a6d38

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.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.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 32dcc003e1973f3db303494f5f63db11091c86a146053773d81ac5484b10c416
MD5 75d4c1f1dad3e6398971f41767e60325
BLAKE2b-256 0cc2aab87be7c315379b13284e63ac74462a51caee8a3a4f871d80557f5c0555

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a73649cd043f5d3e3ae471667c790a7ee2295b22fac7bedcae8705158f8ba111
MD5 e7666b34a235b5e8c77d002cb65c2d7a
BLAKE2b-256 6a9dd43c40083179e8f9c62b7f92c855add4aa73ad9c042173f424a5ee427492

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ec521d14ddcdd9f8d0075d7d1f82e9d8806f7f0a047d2e5bc737e9eddf7f930d
MD5 a4217a89a9ab8dad9a5755b89fd0e1e8
BLAKE2b-256 975165a787c8f5d32b3cf6286015f7c9c04d912481c892dc5b5ef6403d38f54f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.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.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 bd7a6db5dbfae0c93e27cb200bb2b9513e21a90a2d4a259b39a9b5446c4d5aa3
MD5 c1613ab32874e39bb254f9a518dbc581
BLAKE2b-256 4e6d2e19b6aa8ffab9f342783ed0c9497b47d74b61640d6619dd4a75134cb2d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cc27e903da274f76826848832f62e1ec410a43602e1e0cd4f8db8c619b1ee93e
MD5 c9cbb805c8fb3f2bb1e80e8adc0ebf21
BLAKE2b-256 cea165e7a26fff1215f527cdd48c3c49a936e46ce5ab0feaa60be12e45799884

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4301871418f967d0b13409f1bd10ecc7825a7f183282dcc9e19d08532e6cb2e9
MD5 8c6ad9bd8709bbfdc8f0288e068974c6
BLAKE2b-256 576a45e564ff14b268f2be5ac00fda5ae37ebce3577f7aad23976bf62d03ae61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.12.0-cp35-cp35m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.5m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.12.0-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 2d0029314dc87312ff8d46c3724363d847e5235403eced5d3f98da80a87f4828
MD5 044b93875e7d14d7ab06aec6ad9bd719
BLAKE2b-256 e43c69119782f2fae59687e4cf47529cb93dd74d73e391922c123fcce0ef981a

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