EuroPython 2016

High Performance Networking in Python

Speaker(s) Yury Selivanov

The talk will start with an overview of async/await syntax introduced with PEP 492 in Python 3.5. We’ll go through asynchronous context managers and iteration protocols it introduces. I’ll briefly explain how the feature is implemented in CPython core.

Then we’ll explore asyncio design. I’ll briefly cover event loop, policies, transports, protocols and streams abstractions. I’ll explain that event loops are pluggable, which really makes asyncio a universal framework.

We’ll cover libuv - a high performance networking library that drives NodeJS. I’ll highlight where it’s similar to asyncio and how it’s different.

In the final part of the talk I’ll explain how to make an asyncio compatible event loop on top of libuv. I’ll showcase Cython, which is an amazing tool for tasks like this.

Finally, I’ll share some ideas on how we can further improve the performance of asyncio and networking in Python, and what are the challenges that we will face.

Objectives:

  1. Deeper understanding of async/await in Python and why it’s important.
  2. Deeper understanding of asyncio architecture and protocols.
  3. How to improve asyncio performance by implementing custom event loops.
  4. Show that it’s easy to integrate existing complex & low level libraries with Cython.
  5. Some perspective on how Python may evolve wrt networking.

in on Tuesday 19 July at 10:30 See schedule

Do you have some questions on this talk?

New comment