hashinit(): power of 2 fast path

2018-04-28 Thread Anton Lindqvist
Hi, If the elements argument passed to hashinit() is a power of 2 there's no need to find the closest power of 2 that can fit all elements since elements == hashsize will always be true. During boot of a stock amd64 kernel running inside vmd 80% of the calls to hashinit() includes a power of 2 size

Re: hashinit(): power of 2 fast path

2018-04-28 Thread Mathieu -
Anton Lindqvist wrote: > Hi, > If the elements argument passed to hashinit() is a power of 2 there's no > need to find the closest power of 2 that can fit all elements since > elements == hashsize will always be true. During boot of a stock amd64 > kernel running inside vmd 80% of the calls to hash

Re: hashinit(): power of 2 fast path

2018-04-29 Thread Mathieu -
Disregard that, brainfart on my side. Mathieu - wrote: > Anton Lindqvist wrote: > > Hi, > > If the elements argument passed to hashinit() is a power of 2 there's no > > need to find the closest power of 2 that can fit all elements since > > elements == hashsize will always be true. During boot of

Re: hashinit(): power of 2 fast path

2018-04-29 Thread Anton Lindqvist
On Sun, Apr 29, 2018 at 10:52:27AM +0200, Mathieu - wrote: > Disregard that, brainfart on my side. > > Mathieu - wrote: > > Anton Lindqvist wrote: > > > Hi, > > > If the elements argument passed to hashinit() is a power of 2 there's no > > > need to find the closest power of 2 that can fit all elem