On Wed, May 23, 2018, 3:13 PM Gregg Reynolds <d...@mobileink.com> wrote:

> ...

>
>
> There are also major inefficiencies. Just look at CAFindReadyMessage.
> Looping over the fds? Unroll the loop and you get code that is faster,
> smaller, and more readable. Plus, actually reading the fastshutdownFds is
> unnecessary, all that matters is that they force select to return.
>

Compare the iotivity code with
udp_handle_inbound_data()

At
https://github.com/OpenOCF/iochibity/blob/master/src/comm/transport/udpip/udp_data_receiver.c

If you loop, the in the worst case you do FD_ISSET
Dozens of times for no good reason

I think, anyway. But with all the macros, who knows?
Unroll the loop and you minimize that.

Reply via email to