This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author samuelcolvin
Recipients samuelcolvin, yselivanov
Date 2017-06-02.17:47:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496425633.34.0.560515372039.issue30556@psf.upfronthosting.co.za>
In-reply-to
Content
This is best described the script at https://gist.github.com/samuelcolvin/00f01793c118bf9aafae886ffbc81a58.

Basically, completing a set of tasks using asyncio.wait(...return_when=asyncio.FIRST_COMPLETED) in a loop to wait for them to finish is much much slower than completing the same set of tasks using just asyncio.wait(pending_tasks, loop=loop, return_when=asyncio.ALL_COMPLETED).

In my example, the ALL_COMPLETED case takes ~5s, but the FIRST_COMPLETED case takes 18 - 47s.

The screenshot on the gist shows network usage with a very long tail, in other words very few tasks are taking a long time to complete.

This example uses aiohttp get a url as the test case but I'm pretty sure this isn't an issue with aiohttp.

I tried the same thing with uvloop but got broadly the same result.
History
Date User Action Args
2017-06-02 17:47:13samuelcolvinsetrecipients: + samuelcolvin, yselivanov
2017-06-02 17:47:13samuelcolvinsetmessageid: <1496425633.34.0.560515372039.issue30556@psf.upfronthosting.co.za>
2017-06-02 17:47:13samuelcolvinlinkissue30556 messages
2017-06-02 17:47:13samuelcolvincreate