[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-25 Thread Nir Soffer
Nir Soffer added the comment: Using a quick test with 1000 clients sending 100 pings, I could not see significant difference between master and this patch. Seems that the extra copy is hidden by the noise. Having this documented is good enough if someone want to use this. -- stage:

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-24 Thread STINNER Victor
STINNER Victor added the comment: asyncore is now deprecated and I prefer to restrict changes to minimum to avoid regressions. While the change makes sense, it only looks like a very cheap micro-optimization. I don't think that it's worth it. -- ___

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-24 Thread Nir Soffer
Nir Soffer added the comment: The advantage is avoiding wasteful copy on each iteration. -- nosy: +Nir Soffer ___ Python tracker ___ _

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-23 Thread STINNER Victor
STINNER Victor added the comment: Why it may be ok to avoid the copy, what is the advantage of applying the change? The current code is correct. -- nosy: +haypo ___ Python tracker __

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-22 Thread Kevin williams
Changes by Kevin williams : -- nosy: -Nir Soffer, giampaolo.rodola, haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-22 Thread Nir Soffer
Changes by Nir Soffer : -- pull_requests: +2872 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue30994] Asyncore does not need to copy map.items() before polling

2017-07-22 Thread Nir Soffer
New submission from Nir Soffer: Asyncore is not thread safe, and cannot be called from multiple threads. Hence it does not need to copy the socket_map when preparing for poll or select. The copy was introduced in: commit d74900ebb5a22b387b49684990da1925e1d6bdc9 Author: Josiah Carlson Date: