Re: [libnftnl PATCH] chain: Hash chain list by name

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

 



On Tue, Dec 11, 2018 at 06:44:00PM +0100, Phil Sutter wrote:
> Introduce a hash table to speedup nftnl_chain_list_lookup_byname(). In
> theory this could replace the linked list completely but has been left
> in place so that nftnl_chain_list_add_tail() still does what it's
> supposed to and iterators return chains in original order.
> 
> Speed was tested using a simple script which creates a dump file
> containing a number of custom chains and for each of them two rules in
> INPUT chain jumping to it. The following table compares run-time of
> iptables-legacy-restore with iptables-nft-restore before and after this
> patch:
> 
> count      legacy       nft-old        nft-new
> ----------------------------------------------
> 10000         26s           38s            31s
> 50000        137s          339s           149s
> 
> So while it is still not as quick, it now scales nicely (at least in
> this very primitive test).

Applied, thanks Phil.



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

  Powered by Linux