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

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.

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 performance.

Installation

uvloop requires Python 3.5 or greater and is available on PyPI. Use pip to install it:

$ pip install uvloop

Using uvloop

To make asyncio use uvloop, you can install the uvloop event loop policy:

import asyncio
import uvloop

asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

Building From Source

To build uvloop, you’ll need Python 3.5 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, for example:

    $ python3.7 -m venv uvloop-dev
    $ source uvloop-dev/bin/activate
  3. Install development dependencies:

    $ pip install -r requirements.dev.txt
  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.11.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

uvloop-0.11.2-cp37-cp37m-manylinux1_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.7m

uvloop-0.11.2-cp37-cp37m-manylinux1_i686.whl (3.5 MB view details)

Uploaded CPython 3.7m

uvloop-0.11.2-cp37-cp37m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m macOS 10.11+ x86-64

uvloop-0.11.2-cp36-cp36m-manylinux1_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.6m

uvloop-0.11.2-cp36-cp36m-manylinux1_i686.whl (3.5 MB view details)

Uploaded CPython 3.6m

uvloop-0.11.2-cp36-cp36m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6m macOS 10.11+ x86-64

uvloop-0.11.2-cp35-cp35m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.5m

uvloop-0.11.2-cp35-cp35m-manylinux1_i686.whl (3.4 MB view details)

Uploaded CPython 3.5m

uvloop-0.11.2-cp35-cp35m-macosx_10_11_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

File details

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

File metadata

  • Download URL: uvloop-0.11.2.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2.tar.gz
Algorithm Hash digest
SHA256 a97bd62ebbdf7e6e84bf44afe439d9b24ce4d8661a29a639626a8c03748f6f98
MD5 7d509d78b18a5863cc06697ccfd835ad
BLAKE2b-256 5c376daa39aac42b2deda6ee77f408bec0419b600e27b89b374b0d440af32b10

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 251744b1bb162577db2e48cccb28ec9bad4126591471e6ba63dcbe71abc1c741
MD5 4a75b8530860bfdda0a7848486b5a41b
BLAKE2b-256 9cee40f7dfafbd6b014d5faac74577b238199c510cdd3b6a06fe3da09bcabdde

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 cbab9f6de63b10fc4991cbf9a720a8ceecfba501f5571f35fc3a74c76223ea66
MD5 1c9c77dc65f91c961d8536e125d1227b
BLAKE2b-256 2853b79392a51b3d730cfc533f11e86b45920489f9e3b576d3b49a5fc81850f6

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp37-cp37m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp37-cp37m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 4076d40ae0b7557d5982ffe726b153c947a4d70725080ead0121006bdb9f7431
MD5 37bb50a893b544231173cc70c48c6506
BLAKE2b-256 83b9e05c0c492b28f54b831bae42bd20dc1ce3589832e5553adb80eff3705c23

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c2e04cab3e2c71d79002a814a243bc42f0253eb761b1f3af989d38ec8142532c
MD5 b67263ce94ac6431d1cfe2fbc81381f6
BLAKE2b-256 6f621d3561a6c5ce0d0665b815efd1d9cff77a0879905371ec4da6b6ba4ccba9

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0657ebcccb261bdd0a360c83dbc6c1218f13cf5c1a3f381bca68ba5977bb6e5a
MD5 7f1ac5d7eb0021bf2e2cc4701189cf66
BLAKE2b-256 11e8292c944ae4695d00a175bf9cbefbedbdcb0107b3f0bed2db6649d77807e2

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp36-cp36m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp36-cp36m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.6m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 58d6978112ff292cedf2fd754c8085c9a8c6b98737b8ab3cda3d2a081977a91e
MD5 2451542f71c45bb2a93a36cbb8e19d6e
BLAKE2b-256 1d78be5a19e5964f91082cd969bbbfaa12545c29860cd9e25d83bb8b0f794c8b

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d3818242d174a326ea49e2e8f7c1e448432ce17ecb31aeb5084600950857b663
MD5 ea09bc592988e68bd19ccc9a2566290e
BLAKE2b-256 0c0fa591d73b8b691bd37f77e7a6f190bf4d7b3b742637237719d3ddb3ae6b14

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp35-cp35m-manylinux1_i686.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp35-cp35m-manylinux1_i686.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 089b3513db7f2122ac00a9ce18be879d626a566537c93bbcbb54053e3f24acf5
MD5 bdc9b29ca264674f6b28e362632a9348
BLAKE2b-256 13be7a69f2694066b0a2ace8a051d79ed7d18996f39c5f4f33d56d41ffe9aa29

See more details on using hashes here.

File details

Details for the file uvloop-0.11.2-cp35-cp35m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.11.2-cp35-cp35m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.5m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.5

File hashes

Hashes for uvloop-0.11.2-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 f2ffcaa13a5e279d0b3296cd6c691df39876cc818482168a80edd3b0e5deef57
MD5 d09e45fbf872dcdfd1100d8a86359577
BLAKE2b-256 abc6e9eb42cfb72b747fb1284627482b260fdfe0a23b9d5f948aba1138e82eef

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