[New-bugs-announce] [issue28544] Implement asyncio.Task in C

Yury Selivanov report at bugs.python.org
Thu Oct 27 12:33:11 EDT 2016


New submission from Yury Selivanov:

The attached patch implements asyncio.Task in C.  Besides that, it also implements Argument Clinic for C Future.

Performance improvement on a simple echo server implementation using asyncio.streams:

Python Future & Task   |   C Future & Py Task   |   C Future & C Task
      23K req/s        |           26K          |          30K
                       |      ~10-15% boost     |         ~15%

Both Task and Future implemented in C, make asyncio programs up to 25-30% faster.

The patch is 100% backwards compatible.  I modified asyncio tests to cross test Tasks and Futures implementations, i.e. to run Task+Future, Task+CFuture, CTask+Future, CTask+CFuture tests.  No refleaks or other bugs.  All uvloop functional tests pass without any problem.

Ned, Guido, are you OK if I merge this in 3.6 before beta 3?  I'm confident that the patch is stable and even if something comes up we have time to fix it or even retract the patch.  The performance boost is very impressive, and I can also make uvloop simpler.

----------
assignee: yselivanov
components: asyncio
files: ctask.patch
keywords: patch
messages: 279546
nosy: asvetlov, gvanrossum, haypo, inada.naoki, ned.deily, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Implement asyncio.Task in C
type: performance
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45242/ctask.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28544>
_______________________________________


More information about the New-bugs-announce mailing list