Feature #19540

Review and improve the behavior of

Added by Marco Mambelli about 3 years ago. Updated 2 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


In [#18748] the code was changed to use poll/epoll instead of select when possible.
There may be some performance improvements to gain changing the current code.

1. The current code seems to create a new mask for poll/epoll all the time fetch_ready_fork_result_list() is callded.
Specially epoll should work much better if a mask is kept (e.g. as module variable) and file descriptors are added/removed to it when needed. Each modification is supposedly a system call

2. Epoll may not guarantee always the best performance. poll and select work in user space so should cause less context switches than epoll. Select (in C) should work also for >1024 file descriptors if the correct array is passed in (default is 1024 long and would break). Python seems not to allow an input array. It remains to be verified if there is a way around it. # TODO: this may be revised to use select that seems more performant and able to support >1024:

When working on this keep in mind that most python code examples for select/poll/epoll seem superficial. E.g. there is confusion on the meaning of the select flags: read as POLLIN | POLLPRI, no mention of the POLLIN_SET (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR).

Consider also [#18855], the ticket about creating a unit test. The test may also compare performance.


#1 Updated by Marco Mambelli almost 3 years ago

  • Target version changed from v3_2_x to v3_4_x

#2 Updated by Marco Mambelli over 2 years ago

  • Target version changed from v3_4_x to v3_5_x

#3 Updated by Marco Mambelli over 1 year ago

  • Target version changed from v3_5_x to v3_6_x

#4 Updated by Marco Mambelli 2 months ago

  • Target version changed from v3_6_x to v3_7_x

Also available in: Atom PDF