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.

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

uvloop-0.15.0-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.0-cp38-cp38-manylinux2014_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.8

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

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

uvloop-0.15.0-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.0-cp37-cp37m-manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.7m

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

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

uvloop-0.15.0-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.0.tar.gz.

File metadata

  • Download URL: uvloop-0.15.0.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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0.tar.gz
Algorithm Hash digest
SHA256 1a503d5b49da6e3dd5607d6e533a5315b1caedbf629901807c65a23a09cad065
MD5 c97447b8b386971be5e6f4328563be42
BLAKE2b-256 dffb0e1b479ac5502f3d4531a2fc3f046312616f1ad020c686da353c2ff3bbc6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d76da5529025f9771855505cfde7bf16b9b0001e2fe05b0abf3e4fc01a5dfdb
MD5 ff37fbe12dd6a141c2430b9493202f66
BLAKE2b-256 0819846b771cb52360955062d4c8f1e3859d9958e6ec265066b9f268c6a4f3da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 fab95c88d0c3694089c93a8c46fdab30117c4ce0d1afa2ab7d6f4d0607495857
MD5 95c011ee9baa5d6933659656b65775c4
BLAKE2b-256 2f2398e7915c257214465fe5588bc18c882ae6e4c3913c0002a0f603aded061a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ad5391ce33ac1c745dec6f8a394387b3247c374e93b12a1f0403791f6be4bb8a
MD5 8cf0010b9758c543b686945f69117f5f
BLAKE2b-256 8321d158f6a07af200ec5e7fd7d6b36cff86b8b227c2a5ad6812b7cb9a8d9026

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cb121716f4ff5c01dd9b9a12b2193e59383243c21d14c916f588fd626bd3c74b
MD5 a86c40cd23279ab6a7b10df1331366a1
BLAKE2b-256 341564a919debf7f26b697b6ba3e5546c63471a8238a087ea426fb1144d817e8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 08547ec0d40005da5c5f969f406cc90e6d589b41388958e326d78ea63fb5d2f9
MD5 2fc1506d43ea834822dff0893ea93c86
BLAKE2b-256 696a87bdc40585ca257caf6f2b2cd181e287dad6c18b6e0c75e16027e2a91918

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1c114eafd3c53cab74024d122742ed9001611e8f341421dba84a8ea7d886cc2f
MD5 aa3818f60513a29c3c260ab5d7c74c51
BLAKE2b-256 4fe35cd39e424cecc68a07ce915c07831af68ca393966de9c7ae4caad25afd04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9900020313c158cbc7befdd5ad60eb7b5443d7d1e83ad57c310e330fe7b2d858
MD5 1b04800bdbf70e1a16b31fa2060224f4
BLAKE2b-256 54d7cad371ef4fb70a24d8b57fe6fdbc49725939f083cf0568928f9dec730505

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9ae0b0e86ffcfe11c208fdb1552894911aa0915280e904a3757ebd4505792568
MD5 559cf43d22efde828b414c6f75ac0482
BLAKE2b-256 23b2636a70e1f3b649cc983320a3d1bed6dec23dbbb08977b531e6e03dfe1c4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.0-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.1 CPython/3.9.1

File hashes

Hashes for uvloop-0.15.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e17cc3f32288daf8476368ddb60cad0f00ab13c979f6f4003ee773f1d90cab58
MD5 0c3906593d58fa3f5bfcf4d7efc269f2
BLAKE2b-256 0319eaa668f3934ea169bcf942ec339029db1ce134459dd7e809f88dfacac093

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