lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #8911] Optimize lwip_selscan()


From: Joel Cunningham
Subject: [lwip-devel] [patch #8911] Optimize lwip_selscan()
Date: Wed, 17 Feb 2016 22:43:52 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0

URL:
  <http://savannah.nongnu.org/patch/?8911>

                 Summary: Optimize lwip_selscan()
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: jcunningham
            Submitted on: Wed 17 Feb 2016 10:43:51 PM GMT
                Category: sockets/netconn
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

This patch makes a couple of simple re-arrangements in lwip_selscan() that
should improve performance in the following ways:

  1) The old code linearly walked all sockets to maxfd regardless of
     whether they were set in the fd set. The process involved
     acquiring sys arch protect, looking up the socket, and then
     checking if the socket was present in any of the fd sets. On
     systems with lots of sockets and a heavy SYS_ARCH_PROTECT
     infrastructure (a mutex) this can result in a lot of extra work.
     Now we skip this process for any fd that is not in the input sets
  2) If the socket from tryget_socket() is NULL we no longer continue
     and compare the input fd sets with a zeroed out set of events
  3) We no longer need to zero out our event sets because they are
     only accessed when tryget_socket() is successful

lwip_selscan() is called at most once per select call and sometimes up to
three times



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 17 Feb 2016 10:43:51 PM GMT  Name: 0001-Optimize-lwip_selscan.patch 
Size: 5kB   By: jcunningham

<http://savannah.nongnu.org/patch/download.php?file_id=36369>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8911>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]