Use poll() instead of select()

Andrew Morton kde-optimize@mail.kde.org
Thu, 30 Jan 2003 15:10:45 -0800


Shridhar Daithankar wrote:
> 
> >  From the URL:
> > (for 100 fds)
> >  call       microseconds
> >  select  54
> >  poll     50
> 
> Isn't that data little too old? 2.2.14 is really old.

poll() is still somewhat faster than select() on current
Linux kernels.

For 2.5, the new epoll system call is much faster - O(1)
rather than O(n).

See http://www.xmailserver.org/linux-patches/nio-improve.html

So it would be sensible to start abstracting the core fd
polling function out into some switchable layer for when
this stuff comes along.

But this is all moot unless kernel profiling is showing significant
amounts of time being spent in the select() functions.

I assume that someone has run kernel profiles (preferable oprofile)
during KDE operations? Anyone have a pointer to the results?