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

Uploaded Source

Built Distributions

uvloop-0.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

uvloop-0.16.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ x86-64

uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl (2.1 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

uvloop-0.16.0-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.16.0-cp39-cp39-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl (2.1 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

uvloop-0.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

uvloop-0.16.0-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.16.0-cp38-cp38-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl (2.1 MB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)

uvloop-0.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

uvloop-0.16.0-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.16.0-cp37-cp37m-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for uvloop-0.16.0.tar.gz
Algorithm Hash digest
SHA256 f74bc20c7b67d1c27c72601c78cf95be99d5c2cdd4514502b4f3eb0933ff1228
MD5 79f9a7f3cfe154daf0aade23555dc9d4
BLAKE2b-256 abd922bbffa8f8d7e075ccdb29e8134107adfb4710feb10039f9d357db8b589c

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for uvloop-0.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 772206116b9b57cd625c8a88f2413df2fcfd0b496eb188b82a43bed7af2c2ec9
MD5 004c6ce490a0f2c038bf6613207d50f6
BLAKE2b-256 121c4c270b22f68a75bedf795aadc40370c4ff9e910a5e1aff327c24aaae6a99

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for uvloop-0.16.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 bd53f7f5db562f37cd64a3af5012df8cac2c464c97e732ed556800129505bd64
MD5 89c06559e77cb587c43dff9ea8ff5b0d
BLAKE2b-256 b90014dffb56943092c2b5821d288dc23ff36dff9ad3b8aad3547c71b171cf3b

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 30ba9dcbd0965f5c812b7c2112a1ddf60cf904c1c160f398e7eed3a6b82dcd9c
MD5 643ee1c751f2e9f76bc8e77bbf0be440
BLAKE2b-256 daea56fecce56844e308b6ff3c5b55a372a6a4da2c6fe8ee35a272459f534d9c

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6224f1401025b748ffecb7a6e2652b17768f30b1a6a3f7b44660e5b5b690b12d
MD5 3bbc96179b0292b1ca6783c460423412
BLAKE2b-256 2a0775074f9789d5f8811bc77230a84ddbb7586e555e84f59d75d2968ef5c4a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1e5f2e2ff51aefe6c19ee98af12b4ae61f5be456cd24396953244a30880ad861
MD5 43a366dc37206da1565296b9fd3fa9ca
BLAKE2b-256 cbc898fa2d230835fe529e362301e5a852d0413e606ed790af9d96212086ace1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 98d117332cc9e5ea8dfdc2b28b0a23f60370d02e1395f88f40d1effd2cb86c4f
MD5 34f31517cad9ca0298cab0dea011c7eb
BLAKE2b-256 d5a4bf2554658b97ae17d0b0cc62a51b2425c4de9526a76638ab39dff12f1c05

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 089b4834fd299d82d83a25e3335372f12117a7d38525217c2258e9b9f4578897
MD5 e834c3cfa9c558d730be2c847999361b
BLAKE2b-256 bdccd682d7156873e080587ae1b749976ab674d490b3d43f03414707126a9a4c

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6ccd57ae8db17d677e9e06192e9c9ec4bd2066b77790f9aa7dede2cc4008ee8f
MD5 fbd0545f8a497acd8fe8def8aac28ad3
BLAKE2b-256 a2222fba0652a03bac8c38201d5832aaba8d47e6e8dd4e2d05c9746571927ebb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8e0d26fa5875d43ddbb0d9d79a447d2ace4180d9e3239788208527c4784f7cab
MD5 cf9ff1fe498c712b1a12d065020d2fd5
BLAKE2b-256 89bffcd4adf745fa35bd930c4af3e374ffac3a3d0d674992e8167abe21361316

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 647e481940379eebd314c00440314c81ea547aa636056f554d491e40503c8464
MD5 a79f6cf362ec77e025566309efe4201c
BLAKE2b-256 7d61e7003a75c758632e2e72f4dd76e7b3580e680a0fb764e1129515f3f143c6

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bd8f42ea1ea8f4e84d265769089964ddda95eb2bb38b5cbe26712b0616c3edee
MD5 7df979cdcd9cecd6360de8d2656675c7
BLAKE2b-256 745d8d43cca0ef537ebd4fda74519a8e3b61e799b7fa8ae938b1b23116fe3dd9

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e814ac2c6f9daf4c36eb8e85266859f42174a4ff0d71b99405ed559257750382
MD5 88c503f239a84a7e0537b1bb9aebdd01
BLAKE2b-256 30855d96af493078e85f5b268eaba4d9670afe45f28af2933b8cb463e0586f29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3a19828c4f15687675ea912cc28bbcb48e9bb907c801873bd1519b96b04fb805
MD5 6866ca4c2b68a87bfda0552a7df09474
BLAKE2b-256 7e1668cfbc192b0189a950bd385288b3f566d1cc81615c4d3912623d28295fde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uvloop-0.16.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 04ff57aa137230d8cc968f03481176041ae789308b4d5079118331ab01112450
MD5 eda23dea94fa8209c996a9f993c3b221
BLAKE2b-256 50382a0825302b207ff694cb501f7868330d004eeb6ee70470c52c00c2d4e6d2

See more details on using hashes here.

File details

Details for the file uvloop-0.16.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: uvloop-0.16.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for uvloop-0.16.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b572256409f194521a9895aef274cea88731d14732343da3ecdb175228881638
MD5 a87ed607d8d727e7c466b6bdf1c7f288
BLAKE2b-256 192787739cae95fea0ebcd65f1ea3d2925cb290582cb7fcd5d7456ee865a720a

See more details on using hashes here.

Supported by

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