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.0rc1.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.0rc1-cp38-cp38-manylinux2010_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8macOS 10.11+ x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.7mmacOS 10.11+ x86-64

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

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.6mmacOS 10.11+ x86-64

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

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

uvloop-0.14.0rc1-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.0rc1.tar.gz.

File metadata

  • Download URL: uvloop-0.14.0rc1.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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1.tar.gz
Algorithm Hash digest
SHA256 182617c2992a79b268bfd193691c4aacb93634e9d8d96edf560a842a6206411d
MD5 678f41cc6836584fc50cf92f6c0ceda0
BLAKE2b-256 d7ed144f7f12815548b663307c29136d78724165900cece125076d2ff73195ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9ab030794432c47b78199d3f268ac2c898ae85fb9f09e10ae03dd7af62904b0e
MD5 9e10855b70b5e9f8c145f6c9ace88664
BLAKE2b-256 8303fe31ace5ba9e289d2a73dd266ab9de8f0b9b4a24284ec37fd97f0328b4c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp38-cp38-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 469e0e3b80f245ed32f054174e6a69e6a01715dbbb24eb917733fe5af09ad306
MD5 cf6be49042e6de021b3cd965913d47a0
BLAKE2b-256 f8505ad38e32945aee4e6d8145747e0b158de48e23cfb10565978dedd820ab36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 682fa2ab24a758831f531dca122f128373c3dd95a3c8885b5fd1c48775d0024f
MD5 934d5ca6578c4339fd7e09d6c38ac9e3
BLAKE2b-256 ad85839a201730e39f76ee036fea79b81ade5929835e2ce9951f838727f77050

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 c1d55b6926d956a29cf5d7cc891004602ea7cd006b0b80354b9b3d973ca9027f
MD5 01a7d9c2c03b152cf0c9a3ee8be5fc64
BLAKE2b-256 08aebc1f57356ec76ef4b6620fbcc21751efb108bc8fa25cd4244ddd77a85d75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9967fd537f3164607d153900aaae036e9a18015d8478f84406ba58b183f5abfc
MD5 8427f79108aeb925d36d022103626885
BLAKE2b-256 97f432d2f9b3eaff3c2c1888f05417341722311e3cd1a884a57fd97267f20a86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 448b13a1adfc47745b880b5d5b34c975c7851b1cd3b0eafe2569b2250190c797
MD5 06db1589ebe492053d74f5f99ef36a0c
BLAKE2b-256 cafc7d4a4c9609829a1e908146346371f622106b914d6c5cdc9794649c8f65b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 32d2fe6ee6be28a99661e1f02bf6cedb99711df1065a3fb7ba7dd73ccb85f768
MD5 2f23521a84835418513eb1d9f1c8fddf
BLAKE2b-256 a45f5ead827a9b3155172b30fdb8184abd559925a1d0699d161cc7bdbb051038

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uvloop-0.14.0rc1-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.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.6

File hashes

Hashes for uvloop-0.14.0rc1-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 2a0268553d2920108b05250c9711060313851daa60b1052c38b6520320aa50b1
MD5 2a81f898790609e2fffb74b11b7cd7c3
BLAKE2b-256 b7ff9d8e7276408f10ce05406ff36ca97372a4fa2c26d4a686d6040a27ddc557

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