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

Re: iptables -A or iptables -I?



martin f krafft wrote:
also sprach Martin G.H. Minkler <dukeofnukem@gmx.net> [2004.10.19.1907 +0200]:

Inserting is almost never quicker than appending. In fact, I am
having trouble coming up with a data structure where insertions are
as quick as appendages, provided, of course, that the difference
makes sense. After all, appendage is nothing but an insertion at
n+1.

All agreed - After all a ruleset is no FILO stack and I guess in a double-linked list it doesn't really matter which pointers get rewritten when a new element is introduced (beginning or end), only insertion somewhere inbetween should cost about twice as much. Then again there should be an advantage in appending since the last.next pointer only needs to be set to nil but not copied in.

Just tried out switching things around for the fun of it - doesn't seem to make a difference.

regards

Martin



Reply to: