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.2.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.2-cp39-cp39-manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.9

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

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

uvloop-0.15.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for uvloop-0.15.2.tar.gz
Algorithm Hash digest
SHA256 2bb0624a8a70834e54dde8feed62ed63b50bad7a1265c40d6403a2ac447bce01
MD5 92c1a58d83e1b82d1f4ef2ea11e2f014
BLAKE2b-256 446e0cb292e4e6ee1382e2ede458f90c94b4f990b261f738403ac45cb8183bc2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6de130d0cb78985a5d080e323b86c5ecaf3af82f4890492c05981707852f983c
MD5 356a1dcf33e96c8fff31d853a0809a36
BLAKE2b-256 833a356170beaacd4c24781266bdbabc52da88ae6433e7a0b659271df66a8d15

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 44cac8575bf168601424302045234d74e3561fbdbac39b2b54cc1d1d00b70760
MD5 0d76abe7a980ccaf3288f0ba15fb0348
BLAKE2b-256 a51f92dd5dd1d396785e09fa39f6c20392be37b43dae000ac51a0c0ced8f471f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 114543c84e95df1b4ff546e6e3a27521580466a30127f12172a3278172ad68bc
MD5 fd145411d92972c602f9938dd15a7db5
BLAKE2b-256 86e77294f30954d38f5567ec6cf349df234c18f207df94a250e47c8f66b4a6db

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b45218c99795803fb8bdbc9435ff7f54e3a591b44cd4c121b02fa83affb61c7c
MD5 7b4eaea412935a646dc4a6cc6d58f252
BLAKE2b-256 7f7cc8193e59f6021c87eb8d51606e1c164fd42d29cacfe2abc40e08c968d3e0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7ae39b11a5f4cec1432d706c21ecc62f9e04d116883178b09671aa29c46f7a47
MD5 c5b5a9b2c78d7968f747398b353a3eca
BLAKE2b-256 ed016f5cd7e246d09f7d184406d69d02c3c059cfe559f923ab0617498382e66b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 90e56f17755e41b425ad19a08c41dc358fa7bf1226c0f8e54d4d02d556f7af7c
MD5 b2f7b4ab7596f044c286a2dca27b643d
BLAKE2b-256 03e194fc3d54e61eef1a802dbeb88a444203b26a84a7f21ceb4f76ce2a5f180c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 42eda9f525a208fbc4f7cecd00fa15c57cc57646c76632b3ba2fe005004f051d
MD5 52ad34d7fb7863ccbcfb5542bb14cf2f
BLAKE2b-256 e1a398cf41d86529cec17c56730267f75f2b01789fe9fd4a68ce009a0cd407d9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e5e5f855c9bf483ee6cd1eb9a179b740de80cb0ae2988e3fa22309b78e2ea0e7
MD5 2aa782fbab5f155d9182842087e62f3f
BLAKE2b-256 8705805df4850d9659efd69d00076269ae6adcb0e151d1922cff822ead2c432a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.15.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 19fa1d56c91341318ac5d417e7b61c56e9a41183946cc70c411341173de02c69
MD5 2a74a6355648ad100b667487bef74718
BLAKE2b-256 111a354cde59fc6733b370b912b913ab054c5bd8bbf9bf3f1ad69b22a84f7121

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