[MUD-Dev] Naming and Directories?

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Sat Mar 13 23:40:48 New Zealand Daylight Time 1999

[Mik Clarke:]

 >Given a task of sending a message to a specific player, when that player could be
 >located anywhere within the mud, how do you propose to do it faster than by running
 >the list of all connected players?  Sure, a binary index by name might help, but I
 >suspect you'd have trouble seeing the saving...

Depends on how often you do it. After removing some idiocy in my database
code, and skipping the MUD language interpreter, the biggest hits on
my profiling of a test with 600 "machines" was the code that sees who
should get a message whenever a machine does something. E.g., a machine
goes from one room to another. All characters and machines in both
rooms may need to know about that. So, with 600 machines moving around
every couple of seconds, thats an order 600 * 600 = 360,000 cost. It
starts to be noticeable. So, the bit of work I've done recently has
been to start adding more pointers to the agent structures, so that
I can link them together based on location, and also via a table
hashed by locations. The first ring gets me those in the old location.
The hashing gets me to any ring for the new location. I expect a
noticeable speedup once I get all the pointer fiddling right.

(I need to merge characters and machines into consistent agent structures,
so this works better, but thats going to be a lot of work.)

Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg at ami-cg.GraySage.Edmonton.AB.CA

MUD-Dev maillist  -  MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list