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

Note that it is highly recommended to upgrade pip before installing uvloop with:

$ pip install -U pip

Using uvloop

Call uvloop.install() before calling asyncio.run() or manually creating an asyncio event loop:

import asyncio
import uvloop

async def main():
    # Main entry-point.
    ...

uvloop.install()
asyncio.run(main())

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8macOS 10.11+ x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.7mmacOS 10.11+ x86-64

uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.6mmacOS 10.11+ x86-64

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

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.5mmacOS 10.11+ x86-64

File details

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

File metadata

  • Download URL: uvloop-0.14.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0.tar.gz
Algorithm Hash digest
SHA256 123ac9c0c7dd71464f58f1b4ee0bbd81285d96cdda8bc3519281b8973e3a461e
MD5 a2f82abb676756f11f544c6b51caf171
BLAKE2b-256 842e462e7a25b787d2b40cf6c9864a9e702f358349fc9cfb77e83c38acb73048

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.7 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4315d2ec3ca393dd5bc0b0089d23101276778c304d42faff5dc4579cb6caef09
MD5 329d03e4d73558dc741fc339d54450af
BLAKE2b-256 bdc038d013d6cbfa58e7aa8b32bf5095196a3d70dbff90a754817ebf3f49dd74

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 bcac356d62edd330080aed082e78d4b580ff260a677508718f88016333e2c9c5
MD5 402905485d1a54f74eaabae10188becf
BLAKE2b-256 5f66c4ef2614c00841e787081128ce228bcd48f00826a7628453dba3b757dfb1

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0-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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e7514d7a48c063226b7d06617cbb12a14278d4323a065a8d46a7962686ce2e95
MD5 f4f9cd4d796d09ab59abe3e5ba579b0f
BLAKE2b-256 9b7a54a80c03b555af21680a2f3692947b43a0d576d90c4c18cace0fee1ccc0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 afd5513c0ae414ec71d24f6f123614a80f3d27ca655a4fcf6cabe50994cc1891
MD5 406f0652acba2f1dfe52d8ae1d4b304b
BLAKE2b-256 a35b68113d0158d2d5ab118e6d1b7e7c90566dff81a412d07089759c0fc31002

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f07909cd9fc08c52d294b1570bba92186181ca01fe3dc9ffba68955273dd7362
MD5 9091b269beaafb4fcc4c232c658d73c8
BLAKE2b-256 4148586225bbb02d3bdca475b17e4be5ce5b3f09da2d6979f359916c1592a687

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 b4f591aa4b3fa7f32fb51e2ee9fea1b495eb75b0b3c8d0ca52514ad675ae63f7
MD5 d7a407de8d4d740d188b173338dd9431
BLAKE2b-256 3a58fc511dfd10719eb520b1f170f8eba0ab775ea9584926cd1b0c318a4111da

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0-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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4544dcf77d74f3a84f03dd6278174575c44c67d7165d4c42c71db3fdc3860726
MD5 db9265b04c23779dbd374eb55283ebcd
BLAKE2b-256 20dc4d0686044b452c6dbef69980eb457fcdddef0b616064d6c7d0ebbafd3193

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0-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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 08b109f0213af392150e2fe6f81d33261bb5ce968a288eb698aad4f46eb711bd
MD5 ef0caa66ec71786cf84ff3ed42b2a0c1
BLAKE2b-256 ff5e35288ddc210e2f0c8f9c098ef3920a1bb02d4a2fb2783867d7abf726185e

See more details on using hashes here.

Supported by

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