On Fri, Jun 15, 2007 at 02:16:56PM -0700, Dan McDonald wrote:
> and instead get mixed results.  My SPARC numbers go up, but my amd64
> numbers drop slightly.  I'm that by saving a function call explains
> the win on SPARC.  My hack requires htonl() bitmasks, so I used a
> table lookup.  Maybe that's all it takes?  I won't go off on how I
> wish htonl() didn't require a push even when it's in a .il file, but I
> don't know what else to say.  I have dtrace numbers to back me up and
> they are available upon request.

I sent this privately to Dan and he asks that I post it instead.

Can you get rid of that table?  It's huge and rather redundant.

The leading non-zero byte of each mask, I think, is:

        ((2 ^ (8 - (pfxlen % 8)) - 1)

and the remaining non-zero bits are:

        (2 ^ (8 * (pfxlen / 8)) - 1

Lookups into large tables can kill perf because of the effects on the
caches.  A few more instructions, even a whole bunch more, computing the
mask may result in better performance.

Nico
-- 
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to