STINNER Victor added the comment:

> Not sure why? If you pass 0 instead of a tiny value, select() shouldn't 
> behave significantly differently.

I used select() as an example of function where we also changed how the timeout 
was rounded, so we had to decide how to handle backward compatibility.

Rounding select() timeout has an big impact of power consumption in an event 
loop, especially when you use poll() which only has a resolution of 1 ms (and 
not 1 us). If you round 0.1 ms to 0, you enter a busy-loop which burns your CPU 
during 0.1 ms. If you do that many times, it can be much longer than 0.1 ms and 
so be very inefficient.

We had this performance issue in asyncio. We fixed it in asyncio *and* select 
modules. 

https://bugs.python.org/issue20311

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30807>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to