Hi,
applications which use large IO queues spend a lot of time
poll()ing fds. The attached patch tries to minimize the
impact of the O(n) interface by introducing a couple of
changes to _st_vp_idle():
1. The manual iteration over all fds to copy them has been
replaced by a memcpy per IO-queue.
2. The function of the iteration over the final pollfd array
has been changed to only check for active fds and avoid
any memory writes. When an active fd is found, it skips
all further checks for that particular IO queue and
memcpy's the complete fd set.
This patch has been extensively tested under real world
conditions (the application uses about 10K sockets and
frequently st_poll()s 5K of them).
- Sascha Experience IRCG
http://schumann.cx/ http://schumann.cx/ircg
st-fast-poll.patch
Description: Text document
|