STINNER Victor added the comment:

> Overallocating by 50% might be overkill here; I wouldn't imagine most users 
> of epoll.poll would use anything but: (...)

See my second message:
"My patch also overallocates the buffer by 50% to avoid calling realloc() to 
many times. Using the selectors module, maxevents is the number of registered 
FD. Using asyncio, the number of registered FD changes a lot."

If you use selectors or asyncio, max_events depends on the current number of 
registered FD and it almost changes at each call to epoll.poll().

asyncio only registers an FD to listen for read events when the application 
starts to read on this FD. There is also an optimization: it first tries to 
read bytes in non-blocking mode. It only registers the FD if it receives 0 byte 
(if recv() fails with a "woud block" error). It's similar for write events.

----------

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

Reply via email to