Re: Performance

From: Dave Hudson <dave_at_nospam.org>
Date: Fri Jan 20 1995 - 05:00:21 PST

Hi again,

dave wrote:
>
> Greg Hudson wrote:
> >
> > The problem is when you're hashing a lot of keys which happen to be
> > divisible by N, where N is a smallish number. If you're using a prime
> > modulus, this doesn't cause a problem, but if you're using a power of
> > 2 modulus and N is, say, 4, then you're only going to wind up using
> > 25% of your hash buckets.

This statement deserves a virtual beer :-)

> One thing that does spring to mind though is that if I analyse the keys
> we're using and ensure that they're sufficiently randomised for our purposes
> then we'll still get a good spread. I think I'll look at the current values
> ASAP. I know the current code makes an attempt at this with the shift and
> xor op, but perhaps the shift's no large enough say.

I just looked at the portref hashing within the msg_reply() code and found
that our portrefs are neatly aligned on 64 byte boundaries - oops!

I've generated a slight patch to my non-dividing code that mangles the keys
so that the portrefs now go in different places in the hash table and done a
small tweak to the code in msg_reply(). My switch times are now down to
53 us from 54 on my DX/4 (compiled under gcc 1.42 - 2.6.2's good for another
4 or 5 us reduction).

                        Regards,
                        Dave
Received on Fri Jan 20 06:34:08 1995

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:17 PDT