Re: Timings for optimised poll(2)

Dean Gaudet (dgaudet-list-linux-kernel@arctic.org)
Tue, 26 Aug 1997 18:04:16 -0700 (PDT)


On Wed, 27 Aug 1997, Richard Gooch wrote:

> Hm. Perhaps a simple and cheap alternative is to use find_first_bit on
> each fd_set, then take the minimum index of the three, and start
> normal scanning from there. Of course, it won't help in the case where
> you are selecting on descriptors 100,200,300,400,500,600,700,800,900
> or some other such sparse set.

I doubt that sort of input is terribly common, but you never know. On the
other hand, output like that is probably really common. Consider an IRC
server (or say Squid) which is doing select()s on a thousand network
sockets. Only a small handful will have any events associated with them.

You could ask a few people to send you a few hundred lines of "strace -e
trace=oldselect -p <serverpid>" for whatever servers they have that are
select heavy.

Apache isn't very interesting in this sort of analysis ... well 1.2.x do a
bunch of lame single socket select()s which I've fixed in 1.3.

Dean