[quagga-dev 10194] Re: [PATCH 2/4] hash: force size to be a power of 2

Stephen Hemminger stephen at networkplumber.org
Tue Jan 15 17:46:39 GMT 2013


On Tue, 15 Jan 2013 17:49:10 +0100
David Lamparter <equinox at opensourcerouting.org> wrote:

> On Fri, Jan 04, 2013 at 03:29:21PM -0800, Stephen Hemminger wrote:
> > By forcing the hash table size to be a power of 2, a potentially
> > expensive divide can be replaced by a mask operation. Almost all
> > usage of the hash table was using default size of 1024. Only places
> > with different size was thread library (1011) and bgp aspath.
> 
> Since I can't really estimate the impact this has (in particular the
> AS-Path part?), I'm going to defer this (and the other hash patch from
> your next series) until after 0.99.22.
> 
> Looks good otherwise,
> 
> -David

As best I can tell the reason the original developer wanted to use
1011 rather than 1024 was that  the thread library is using the function
address is used as hash key, and the function address will be aligned.

I didn't see enough threads to worry about it, and the hash lookup
of thread is only done when thread is created.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20130115/5a3e5586/attachment-0001.sig>


More information about the Quagga-dev mailing list