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.13.0rc1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

uvloop-0.13.0rc1-cp37-cp37m-manylinux2010_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.7m macOS 10.11+ x86-64

uvloop-0.13.0rc1-cp36-cp36m-manylinux2010_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.6m macOS 10.11+ x86-64

uvloop-0.13.0rc1-cp35-cp35m-manylinux2010_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

uvloop-0.13.0rc1-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.13.0rc1.tar.gz.

File metadata

  • Download URL: uvloop-0.13.0rc1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1.tar.gz
Algorithm Hash digest
SHA256 52a227559e2284982e5f10b62f0498a191924ab53e27fdba6b243459b43ffae5
MD5 a44459bf96276e2299a7a9ef01dd482a
BLAKE2b-256 df51d7eea863725bda3b3fa12e7c339ca74f1231eb4ff9ef10413b20052222af

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 99904cc445d510295094be6dbb8d1cbad6bc729f58643bf568fd617214afd504
MD5 edef59dbb7ce67a148792bc3a53c1dcb
BLAKE2b-256 25d0b7279abd6fddd701d4ffa192c3bd5b8aef50ec6b01fac7913c9f9fd244a6

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp37-cp37m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 681d2ab0c266498e7fc36df3e07001602cd4526ca2158c7a4532cf9eddaef583
MD5 ed80e92d3888108f272bff271bc1717c
BLAKE2b-256 9aacbf8f47b253925e9b94c189bc532b54a3a45132a92686578da57b626b7423

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3674b1b2a3c91df385a335e41e31048a466574883b6a0a3ac1496509e8a0acd8
MD5 a6d7de61223f2d3d24ebc67a0944f8af
BLAKE2b-256 65d7fda7a25945f27aa0ad5d03fd92bdd197c8e022d34585b9f92c7793c37f41

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp36-cp36m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 6104f8078c3a68163d3cfc8fadc7881b2e58a9c3a45e09b9487b45bd8678510c
MD5 3763b8e69c668b5dfadd9e8649c9d569
BLAKE2b-256 e26aa472d8e5903384ddf63318be5b0a93fee1fbf1d59b509cfedd5b92b79e93

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ec4ecf0d2803dc3fa58d3efc05de5d50ab9a39b5203d9bca4f059ec3be22de87
MD5 a7621fc710babc20d8c12260c8a0b98f
BLAKE2b-256 c190a0f78eaf1c63423f7f682f441d5d2aadd6ffefbb36c9148df1b5ed8f22b5

See more details on using hashes here.

File details

Details for the file uvloop-0.13.0rc1-cp35-cp35m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.13.0rc1-cp35-cp35m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.5m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.13.0rc1-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 8108769060e20760503be305c805ab435aa404822475f64b064d1e1df9061e74
MD5 9b1db4ccdbcdc687076954e5b416e4ac
BLAKE2b-256 c9bc1b887bf2628f2380d72368186ef3793fd0a17320f9461000875b76cf592c

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