tasklwIP - A Lightweight TCP/IP stack - Tasks: task #7497, Sort lists (pcb, netif, ...) for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #7497: Sort lists (pcb, netif, ...) for faster access

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Wed 28 Nov 2007 08:51:14 PM UTC
   
 
Category:  None Should Start On:  Wed 28 Nov 2007 12:00:00 AM UTC
Should be Finished on:  Wed 28 Nov 2007 12:00:00 AM UTC Priority:  3 - Low
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  100%
Open/Closed:  Closed Planned Release:  None
Effort:  0.00

Fri 30 Nov 2007 09:45:08 AM UTC, comment #3: 

Added 'sorting' to udp_input (only connected pcbs are put to the front of the list) and raw_input (a pcb that has eaten the packet is put to the front of the list).

Simon Goldschmidt <goldsimon>
Group administrator
Thu 29 Nov 2007 07:52:24 AM UTC, comment #2: 


> First of all, it appears this is already done for TCP PCBs.


Actually, I didn't check...

For netifs, it really might not be necessary. But we should make sure loopif is added (netif_add) before the (supposedly more used) ethernet interface in the examples in contrib (the last added netif is the first on the list -> faster).

I'll check TCP and see what is best for UDP & RAW.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 29 Nov 2007 12:49:40 AM UTC, comment #1: 

First of all, it appears this is already done for TCP PCBs.

For raw and UDP PCBs, the comparisons in each loop are very expensive (well, potentially for raw, since who knows what will get done in each callback), so it is worth doing, even if there were only two in the list!

For netifs, it's less clear as I think most people will have a single netif (not even loopback), and some may have 2, but infrequently more. The checks on each iteration are not substantial, so IMHO I say leave it as present, which is better for the single netif case.

Jonathan Larmour <jifl>
Group Member
Wed 28 Nov 2007 08:51:14 PM UTC, original submission:  

Since many accesses to internal structures in lwIP is done through a single-linked list, wouldn't it be nice to speed up the search time by putting the last accessed item on the front of the list?

For example in udp_input: once a udp_pcb receives a packet, take out that pcb from the middle of the list and let udp_pcbs start with it, so next time it is hopefully found faster? At the same time, we could use stats_proto.cachehit to show how much it helps...

Places to change would be
- netif list
- udp pcbs
- raw pcbs
- tcp pcbs (at least the connected ones)

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jifl (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-11-30 goldsimon Percent Complete0% 100%
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2007-11-30 goldsimon StatusNone Done

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code