Changeset 8a58afd


Ignore:
Timestamp:
12/07/18 16:46:53 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
c337c9f9
Parents:
1dc033a
Message:

format_ndag: only call FD_ZERO if we're going to use the fd set

A surprising amount of our "receive" workload is calling FD_ZERO
when, most of the time, our buffers contain enough packets that we
never need to call select() anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_ndag.c

    r2193905 r8a58afd  
    10501050        gottime = 0;
    10511051
    1052         FD_ZERO(&fds);
    1053 
    10541052        if (rt->maxfd == -1) {
    10551053                return 0;
     
    10761074                }
    10771075#endif
     1076                if (maxfd == 0) {
     1077                        FD_ZERO(&fds);
     1078                }
    10781079                FD_SET(rt->sources[i].sock, &fds);
    10791080                if (maxfd < rt->sources[i].sock) {
Note: See TracChangeset for help on using the changeset viewer.