
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-11-07 13:15 bypitrou, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 4314 | merged | pitrou,2017-11-07 13:21 | |
| PR 4322 | merged | pitrou,2017-11-07 16:27 | |
| Messages (13) | |||
|---|---|---|---|
| msg305752 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-07 13:15 | |
Each time a new future, handle or task is created, asyncio with debug mode enabled will parse the whole call stack and create a StackSummary object for it. Imagine a recursive coroutine: with N nested calls, you get O(N**2) performance.Ideally debug mode wouldn't slow things too much, at least for development and testing setups. | |||
| msg305757 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-07 13:32 | |
If this is accepted on the principle, it would be great to also patch 3.6. | |||
| msg305777 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-07 16:23 | |
New changeset921e9432a1461bbf312c9c6dcc2b916be6c05fa0 by Antoine Pitrou in branch 'master':bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)https://github.com/python/cpython/commit/921e9432a1461bbf312c9c6dcc2b916be6c05fa0 | |||
| msg305780 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-07 16:50 | |
New changesetd8d218ffda6b7569625ff9edadbbc9a2b1055e32 by Antoine Pitrou in branch '3.6':[3.6]bpo-31970: Reduce performance overhead of asyncio debug mode. (GH-4314) (#4322)https://github.com/python/cpython/commit/d8d218ffda6b7569625ff9edadbbc9a2b1055e32 | |||
| msg305781 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-07 16:51 | |
Thank you for the quick reviews! | |||
| msg305784 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-11-07 16:55 | |
Thank you for helping with asyncio! I'll try to get to that transport performance issues you found sometime this week. I've a few ideas how to add 0-copy support to protocols. | |||
| msg305834 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-08 13:12 | |
> I've a few ideas how to add 0-copy support to protocols.I'd be interesting to hear about them. The main challenge IMHO is to find a way to allow a readinto()-like functionality. | |||
| msg305836 -(view) | Author: Giampaolo Rodola' (giampaolo.rodola)*![]() | Date: 2017-11-08 13:40 | |
>> I've a few ideas how to add 0-copy support to protocols.> I'd be interesting to hear about them. The main challenge IMHO is to find a way to allow a readinto()-like functionality.Exposing sendfile() should be straightforward. I started implementing it years ago but I gave up pretty soon because asyncio had no solid test framework for testing an actual data transfer between two sockets and that basically represented a blocker. Basically back then all recv() / send() related tests were mocks. Not sure about the current situation but if that has changed I would be happy to contribute a PR (I was the one who contributed socket.sendfile()).As for a readinto()-like functionality: the only thing I'm aware of is splice() syscall but it's Linux only. It must be noted that also sendfile() is UNIX only. Windows achieve the same via TransmitFile. | |||
| msg305837 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-08 13:42 | |
Le 08/11/2017 à 14:40, Giampaolo Rodola' a écrit :> Exposing sendfile() should be straightforward.sendfile() is not useful for data that's read from (or written to) memory.> As for a readinto()-like functionality: the only thing I'm aware of is splice() syscall but it's Linux only.This is not the abstraction level we are talking about. The problem isthe Protocol API imposes copies by default (data_received() gives you anarbitrarily-sized bytes object that doesn't match how your protocolchunks data). | |||
| msg305838 -(view) | Author: Giampaolo Rodola' (giampaolo.rodola)*![]() | Date: 2017-11-08 13:44 | |
Sorry. It looks like I completely misunderstood. =) | |||
| msg305839 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-11-08 13:44 | |
> The problem is the Protocol API imposes copies by default (...)IMHO performance is a good motivation to enhance the asyncio API ;-) The tricky part is to keep the backward compatibility. | |||
| msg305840 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-11-08 13:44 | |
> IMHO performance is a good motivation to enhance the asyncio API ;-) The tricky part is to keep the backward compatibility.Let's stop the discussion in this ticket :) | |||
| msg305841 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2017-11-08 13:45 | |
In any case, I think this is better discussed on async-sig (where I already started a discussion thread some weeks ago -- see """APIs for high-bandwidth large I/O?"""). | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:54 | admin | set | github: 76151 |
| 2017-11-08 13:45:41 | pitrou | set | messages: +msg305841 |
| 2017-11-08 13:44:56 | yselivanov | set | messages: +msg305840 |
| 2017-11-08 13:44:11 | vstinner | set | messages: +msg305839 |
| 2017-11-08 13:44:04 | giampaolo.rodola | set | messages: +msg305838 |
| 2017-11-08 13:42:29 | pitrou | set | messages: +msg305837 |
| 2017-11-08 13:40:21 | giampaolo.rodola | set | messages: +msg305836 |
| 2017-11-08 13:12:29 | pitrou | set | messages: +msg305834 |
| 2017-11-07 16:55:33 | yselivanov | set | messages: +msg305784 |
| 2017-11-07 16:51:22 | pitrou | set | status: open -> closed resolution: fixed messages: +msg305781 stage: patch review -> resolved |
| 2017-11-07 16:50:52 | pitrou | set | messages: +msg305780 |
| 2017-11-07 16:27:21 | pitrou | set | pull_requests: +pull_request4280 |
| 2017-11-07 16:23:33 | pitrou | set | messages: +msg305777 |
| 2017-11-07 13:32:01 | pitrou | set | messages: +msg305757 |
| 2017-11-07 13:29:53 | pitrou | set | nosy: +asvetlov |
| 2017-11-07 13:21:46 | pitrou | set | keywords: +patch stage: patch review pull_requests: +pull_request4273 |
| 2017-11-07 13:15:04 | pitrou | create | |