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.

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.5 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.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:

    $ 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.14.0rc2.tar.gz (2.0 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.14.0rc2-cp38-cp38-manylinux2010_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

uvloop-0.14.0rc2-cp38-cp38-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8macOS 10.11+ x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

uvloop-0.14.0rc2-cp37-cp37m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7mmacOS 10.11+ x86-64

uvloop-0.14.0rc2-cp36-cp36m-manylinux2010_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

uvloop-0.14.0rc2-cp36-cp36m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6mmacOS 10.11+ x86-64

uvloop-0.14.0rc2-cp35-cp35m-manylinux2010_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

uvloop-0.14.0rc2-cp35-cp35m-macosx_10_11_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.5mmacOS 10.11+ x86-64

File details

Details for the file uvloop-0.14.0rc2.tar.gz.

File metadata

  • Download URL: uvloop-0.14.0rc2.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2.tar.gz
Algorithm Hash digest
SHA256 7d557bf49991e3f2b70298b117fc09791eba0115af2198a5a385eab85c776130
MD5 e2c6e4495e54fc0bc2358147d21a1a28
BLAKE2b-256 39acfcd82cfe51b6fd399297365cb181e5524c8484bd44ef1013da454fed91a2

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-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/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 667463aa2a2f6ed0a51a631f204a1ae9c71c8e49e2d8d82b3b9bf32833a7de83
MD5 68f4ed7cb068bababa846d3c5aed076d
BLAKE2b-256 cd313a6176aa5f0faccb35f5f45be0d3f7af3612fb37915a9280158a050f9bab

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp38-cp38-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp38-cp38-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp38-cp38-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 b5c5a51b09ef6e787faadb5bcbd88d117c5136a162c40629a0d98707ae05dc6b
MD5 bd11e347baaf6d97adc1af4a156eec50
BLAKE2b-256 16d878c57edacb310e5c1d71eddbe39a3e1e6fb28e82fcbfafa1b3ea0230ed1c

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-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/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 61b898682e3dc3673216f1c6678013d8f758304013d897f56d8bdc1d4ffe04e3
MD5 2883d5ecfaf55fa34b2b9dc3fbaf2628
BLAKE2b-256 e52472dde545df727df4cc09f81246b6e29687d61c02b6a3da6a6a3ced74bc37

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp37-cp37m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp37-cp37m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 117357af2b79d9183675adace1e1e1b3400be81fdd54cdc8feb6a54724f099ca
MD5 24ac6de263395bc4c83030daceafac2e
BLAKE2b-256 e568d128b443cedb4e02cddde2f5a37fae9c7c697e7b2a9910354d4ee11065d4

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c0f69bc2e750b5370010c48c9825c6785487d60fa26025df6206f33b5027fc56
MD5 c5924b229c27773f1b95c5069fd47295
BLAKE2b-256 886894a6b344c23830f61bbe61e5bb6a8fabd32b3eda90436ddcc795fd2b67a1

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp36-cp36m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp36-cp36m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 aa10c0246425d8e7f494c639473427a35831222af5a2b0cb59eab251715a0d09
MD5 5c2f955a1798babf4f69f7526ad919d6
BLAKE2b-256 f952896d43cefe4be4a493572a09b7ab5801dbad1bd97c62a001c9f81a6792f1

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2cffc419a627bc71285d9481c869228a84f56358e54b1f683bc1d4be19b66651
MD5 c434a1212cb79fbce2f9e88d27ab2210
BLAKE2b-256 b19870052ee69074046e59661017fd1d41c98f68981ecee17adb4bc91fccb645

See more details on using hashes here.

File details

Details for the file uvloop-0.14.0rc2-cp35-cp35m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: uvloop-0.14.0rc2-cp35-cp35m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.5m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc2-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 426074b9f5ee5865fcf0818252c16e72446e97578349d8b58ae3a666dacd8e38
MD5 13ff8ce4ce49b27527f3a4a091475741
BLAKE2b-256 97016613eb5f71637aa20db15d66e82577fc0e81a3f5508750c38ad5cd6e6e7f

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