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.3.tar.gz (2.1 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.15.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: uvloop-0.15.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for uvloop-0.15.3.tar.gz
Algorithm Hash digest
SHA256 905f0adb0c09c9f44222ee02f6b96fd88b493478fffb7a345287f9444e926030
MD5 3988441fba215dca6a0b98bbacfaf482
BLAKE2b-256 4149d2cdac6450430f444d3df59ccd1abc8225ea51ffcecd9ac2e36b111074a4

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1ff05116ede1ebdd81802df339e5b1d4cab1dfbd99295bf27e90b4cec64d70e9
MD5 4c098a208b2b0857c351a86f715923e7
BLAKE2b-256 5b903c2b1b9e16bd72c30ea01f44e82fa0b909d7c96672a6a6aa3844641ec4fa

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 5cda65fc60a645470b8525ce014516b120b7057b576fa876cdfdd5e60ab1efbb
MD5 d217dc49649ff3c6efde7873f618c639
BLAKE2b-256 ba56a811b27805c92c2131292b0894b95fefccf6b378db25f754eb73869c0eff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.3-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.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for uvloop-0.15.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 63a3288abbc9c8ee979d7e34c34e780b2fbab3e7e53d00b6c80271119f277399
MD5 b3410407079b1176be954403731914e2
BLAKE2b-256 7ab4d807a57622cdced4e3c2298cc9aac61c5b5b730368a885f4fece13824b53

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d8ffe44ae709f839c54bacf14ed283f41bee90430c3b398e521e10f8d117b3a
MD5 94514fff22297a230f5a563ef51ad545
BLAKE2b-256 c008eed08251fe64702e0ebce65f6117484e46cfe94abca61746ca12f7a307bf

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7f4b8a905df909a407c5791fb582f6c03b0d3b491ecdc1cdceaefbc9bf9e08f6
MD5 3a0a85cedf0559ae19e9fae833fceb45
BLAKE2b-256 5cf8e1f6b14ac2657224daa23bc71e9d3724b6a7444ad48f969406b8ba63df63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.3-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.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for uvloop-0.15.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0de811931e90ae2da9e19ce70ffad73047ab0c1dba7c6e74f9ae1a3aabeb89bd
MD5 587212d3632cbacf4d92912c6d78ff36
BLAKE2b-256 b97bdbc81697c550b5694b89cf653fc08c9055a235114ee753f09c7ff9b8e94c

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ae2b325c0f6d748027f7463077e457006b4fdb35a8788f01754aadba825285ee
MD5 9821ba50d978874d9a95ad20054f83b2
BLAKE2b-256 ade376e668cd7fc8d79310fc2aae33880c72674709d0a3e6449d270892531185

See more details on using hashes here.

File details

Details for the file uvloop-0.15.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.15.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7522df4e45e4f25b50adbbbeb5bb9847495c438a628177099d2721f2751ff825
MD5 ebab5e36e207c3e3f64e305b164fa22e
BLAKE2b-256 13ca80ce4600e8c9bc29385be66a8c62cd159e3c7d1f94e5bad15cab9d3378ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.15.3-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.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for uvloop-0.15.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e71fb9038bfcd7646ca126c5ef19b17e48d4af9e838b2bcfda7a9f55a6552a32
MD5 4f77f7ae49a8d757e0cd4cdf257f5981
BLAKE2b-256 cc1c0a5978d60aa6b1d6490a1385ba0e25f0352c1b796ea97abf45fba09fb358

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