Re: [PATCH 1/2] iptables/libiptc perf issue: Sorting chain during pull-out

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

 



Jesper Dangaard Brouer wrote:
Performance optimize scalability issue:
  Sorting chain during pull-out give worst-case runtime O(Chains^2).

When pulling out the blob, every chain name is inserted alphabetically
into a linked list (by function iptc_insert_chain()).  The problem
with this approach is that the chain names delivered in the blob is
already sorted (as we push it back to the kernel sorted).

This cause chain parsing to always process every element in the chain
list and finish with a tail add.  Causing worst-case runtime O(C^2/2)
for alphabetically sorting of chains.

The patch solves this by only calling iptc_insert_chain() when
creating new chains.


Applied, thanks a lot.
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux