ev_io mode switching performance

Nick Zavaritsky mejedi at gmail.com
Wed May 28 08:43:09 CEST 2014


> Well, obviously, you need to call a function or macro every time you toggle
> the flags.
> Apart from that, it doesn't matter whether you toggle once or many times per
> event loop iteration - when libev polls for new events, it will tell the
> backend about them.
> For select and poll, the overhead is trivial, for kqueue and epoll, its
> nontrivial and even partially depends on outside events. In the worst
> case, it is one extra syscall per fd with epoll, in the best case, the
> overhead is trivial with epoll.

Thanks a lot!

I am most interested in the epoll backend. Does libev issue a epoll_ctl() for every
io watcher that changed mode in the last iteration or the behavior is somewhat
more sophisticated (i.e. no epoll_ctl() when the ‘initial’ and ‘final’
modes were the same)?

More information about the libev mailing list