[zeromq-dev] IPC latency

Steven McCoy steven.mccoy at miru.hk
Tue Feb 2 05:38:54 CET 2010


On 8 January 2010 18:13, Erik Rigtorp <erik at rigtorp.com> wrote:

> On Fri, Jan 8, 2010 at 10:09, Steven McCoy <steven.mccoy at miru.hk> wrote:
> > 2010/1/8 Martin Sustrik <sustrik at 250bpm.com>
> >>
> >> while (!nevents)
> >>     nevents = poll (fds, timeout=0);
> >>
> >> has better latency than blocking poll:
> >>
> >> nevents = poll (fds, timeout=INFINITE)
> >>
> >
> > The code has non-blocking read loop compared with a blocking read loop,
> so
> > not really valid for extrapolation to poll.  All it's saying is blocking
> > read is slow, which isn't particularly remarkable.
>
> Are you saying that first doing select/poll/epoll and then reading is
> faster even for one fd?
>

Generally poll(0) is going to be considered slower and have worse
performance.  However there are going to be instances were it is faster,
considering busy-wait is not often going to be unscheduled.  Not often do
you have one core completely free to dedicate to polling.  It also depends
upon system call overhead of the poll, it should be faster to exit the poll
and read compared to enter and exit the poll call then read.

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100202/758c4efd/attachment.htm>


More information about the zeromq-dev mailing list