Author vstinner
Recipients josh.r, serhiy.storchaka, vstinner, yselivanov
Date 2016-01-28.17:09:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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.
Date User Action Args
2016-01-28 17:09:06vstinnersetrecipients: + vstinner, serhiy.storchaka, yselivanov, josh.r
2016-01-28 17:09:05vstinnersetmessageid: <>
2016-01-28 17:09:05vstinnerlinkissue26233 messages
2016-01-28 17:09:05vstinnercreate