[MUD-Dev] Naming and Directories?

Ola Fosheim Grøstad <olag@ifi.uio.no> Ola Fosheim Grøstad <olag@ifi.uio.no>
Mon Mar 15 22:53:26 CET 1999


Nathan F Yospe wrote:

> of looking up words. My implementation was similar, except that I had an
> extra level of switching when the wordbag got small... a bag that was at
> least seven links full had the 26 branches, but the smaller ones had the
> optimization of holding no empty links, and rapid-checking the links. In
> testing, I'd found this became faster than the array-indexing at smaller
> sizes, for some reason. I still haven't a clue as to why this would come
> to be...

You didn't happen to test this with a tight loop? If you did, then it
most likely was caused by the the non-array implementation being held in
the primary cache which is usually small (8K on a Pentium). Caches are
very sensitive to non-continuous hits. This does of course not matter at
all if the cache was wiped by some intermediate code anyway. Something I
would expect to be the case for real life user-name lookups.

I don't have any good documentation right here, but if I am not mistaken
this would be bad for a Pentium cache...

   for(int i=0; i<257; i++) x += bytetable[i*32];
   for(int i=0; i<256; i++) y -= bytetable[i*32];

Actually it is more complicated than this... I believe accessing a
fewer bytes could be bad if you are are unlucky with the address
locations...

--
Ola Fosheim Groestad,Norway      http://www.stud.ifi.uio.no/~olag/


_______________________________________________
MUD-Dev maillist  -  MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev




More information about the mud-dev-archive mailing list