Skip to content
Ultra fast asyncio event loop.
Branch: master
Clone or download
Latest commit 73529c5 Mar 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ci
.github
docs Enforce consistent code style with flake8 Feb 16, 2019
examples/bench Enforce consistent code style with flake8 Feb 16, 2019
tests Round delay in call_later() Mar 18, 2019
uvloop Round delay in call_later() Mar 18, 2019
vendor
.editorconfig
.flake8 Enforce consistent code style with flake8 Feb 16, 2019
.gitignore
.gitmodules
.travis.yml
LICENSE-APACHE Update license files for GH Sep 13, 2017
LICENSE-MIT
MANIFEST.in Update manifest.in to include both licenses Jul 5, 2016
Makefile Unbreak CI May 30, 2018
README.rst
performance.png readme: Add a section about uvloop performance May 22, 2016
pytest.ini
requirements.dev.txt
setup.py setup.py: Use raw string for regexp Jun 21, 2018

README.rst

https://travis-ci.org/MagicStack/uvloop.svg?branch=master 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

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())

or, starting with uvloop 0.12:

import uvloop

uvloop.install()

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.