lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #6827] etharp could need some tuning


From: Jonathan Larmour
Subject: [lwip-devel] [task #6827] etharp could need some tuning
Date: Fri, 27 Apr 2007 12:09:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070223 Fedora/1.5.0.10-1.fc5 Firefox/1.5.0.10

Follow-up Comment #1, task #6827 (project lwip):

Just a general thought about the first point: lwIP uses simple lists and
arrays in lots of places for the reason that the memory overhead is small.
Something like an RB tree would be much faster, but not really in the lwIP
ethos. So anything more complex may need to be an option, depending on how
it's implemented.

One simple way to improve things without memory penalty would be on the basis
that commonly used destinations would be found faster if they were nearer the
start of the array. We don't want to potentially re-sort the array every time
we get a request though, nor change the array to a list. So one alternative
instead is that every time you get a match, swap the array entry with the one
before it (until it's at the start). Commonly used hosts will then rapidly
gravitate to the start of the table.

In fact, if the number of destination hosts is small, which I think it
probably is in practice for most users, an RB tree (for example) would be
slower on average than this.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6827>

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





reply via email to

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