On Tue, Jul 8, 2014 at 1:17 AM, Magnus Fromreide <ma...@lysator.liu.se>
wrote:

> On Mon, Jul 07, 2014 at 05:33:53PM -0400, Bill Fenner wrote:
> > When doing some performance measurement, I found that a surprising amount
> > of time was spent in netsnmp_large_fd_set_resize().  It turns out that a
> > newly-created large fd set often has an lfs_setsize of zero, and a
> desired
> > size of FD_SETSIZE, and the current code zeroes out the bits in between
> > lfs_setsize and the desired size one by one, with a for loop.  Of course,
> > the FD_ZERO macro exists exactly for this purpose, so I added a special
> > case for this:
> >
> https://sourceforge.net/p/net-snmp/code/ci/ca9d4a356041866d99cc1a91a356cec129aaa23f/
> >
> > Does this seem reasonable?
>
> Yes, but maybe you could mention the motivation for the branch and not just
> what the code does in the comment?
>

Do you mean a structure more like:

        /*
         * Unix: when enlarging, clear the file descriptors defined in the
         * resized *fdset but that were not defined in the original *fdset.
         */
        if ( special case ) {
            /* We can use FD_ZERO in this case */
            FD_ZERO();
        } else {
             for loop;
        }

?

  Bill
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to