Skip to main content

Fast implementation of asyncio event loop on top of libuv

Project description

https://img.shields.io/github/workflow/status/MagicStack/uvloop/Tests 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.

https://raw.githubusercontent.com/MagicStack/uvloop/master/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.7 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.7 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 -e .[dev]
  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.15.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

uvloop-0.15.1-cp39-cp39-manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.9

uvloop-0.15.1-cp39-cp39-manylinux2010_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

uvloop-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

uvloop-0.15.1-cp38-cp38-manylinux2014_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.8

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

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

uvloop-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

uvloop-0.15.1-cp37-cp37m-manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.7m

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

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

uvloop-0.15.1-cp37-cp37m-macosx_10_14_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: uvloop-0.15.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1.tar.gz
Algorithm Hash digest
SHA256 7846828112bfb49abc5fdfc47d0e4dfd7402115c9fde3c14c31818cfbeeb63dc
MD5 dbbfc052d138673de358d099363440ce
BLAKE2b-256 94989dc814f391b2293ecc790b9752e005296c69c3694fd9975b6cb77c448135

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp39-cp39-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1ae1ad731c8c0dcee80e0ecf06274f0f7293244d2cef81fa2747321a370a6aba
MD5 304f5e9dd3bc02fcf2a544183888609f
BLAKE2b-256 e1739f916a5c2fa4a2ecace79c59ce056bb570179ddbbc53b351a1881d853175

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ca8a9e982f0bfbe331f41902cdd721c6e749e4685a403685e792b86a584f5969
MD5 6475c64d40208798a1c904ec2e7f2e8f
BLAKE2b-256 64c8fc83256cd6734efcd0dd7b64adbed6396a5483eba6b319e9a46893274f71

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 236a3c31096e0845029856f7bc07a938340c2cdb35d9d39b38c9253b672bf948
MD5 cea3ade72aee3c212124703714a8f96d
BLAKE2b-256 f462b74963676906c7b121ebc0c2f696abd0bab1fe906d61b059c2c4ca430c52

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed073d24e0c383c24d17d3a2bb209b999ff0a8130e89b7c3f033db9e0c3bd04f
MD5 3891e766ce4e53f2ab34751aca39a4b5
BLAKE2b-256 5ab6e6be6d442c0eaf04a1664cd30d697e3a9b53485afa1f907ca1623a388a23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.1-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/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e72779681f839b6a069d7e7a9f7962a1d1927612c5c2e33071415478bdc1b91b
MD5 967dd9a28962fd12df1a591c99f24106
BLAKE2b-256 50c606a923e520e60b0432afa8d5851fbd1a2c0b5e5390443a8846bb5d833ba7

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 66881fe8a2187334c4dd5010c56310bdf32fe426613f9ca727f090bc31280624
MD5 5051d04c3cf1fcdaaf886a61cef5f337
BLAKE2b-256 28ca99ff96f06763bec9f98929d225a14277531227b0fe46d2494606007759f9

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp37-cp37m-manylinux2014_aarch64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp37-cp37m-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 47ec567151070ed770211d359ad9250b59368548c60212c7ef6dda3f5b1778f6
MD5 e85d3b6b938040bf627fcf4f2b2e35e2
BLAKE2b-256 227d6a2809bc3fe10d58ace4ffbe5c90e3fbb52523aa2775d50f2708c56ef925

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.1-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/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e178c255622d928d464187e3ceba94db88465f6b17909c651483fb73af8d8b85
MD5 8ae1a75997ebe71b5f4ba8b9a3b1ba6b
BLAKE2b-256 4ccc4703d9b6ca16c689e364aee51ef5dd45f907614f568f7d490d7ef9646ba1

See more details on using hashes here.

File details

Details for the file uvloop-0.15.1-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: uvloop-0.15.1-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9541dc3f391941796ae95c9c3bb16b813acf9e3d4beebfd3b623f1acb22d318d
MD5 5ed1e07c0b004f5b7883b659ac3caafa
BLAKE2b-256 e6ed8e893c65ba6d025221f63261154ca598feaf2daef02e5a69177a1d6dcdb0

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