[MUD-Dev] Re: TECH: Distributed Muds

Nick Walker nick at geekspace.com
Wed Apr 25 00:05:02 CEST 2001


On Tue, 24 Apr 2001, Brian Hook wrote:

> I hope I'm not insulting anyone by stating what may or may not be
> obvious, but linear searches in linked lists are very, very bad.  I
> would assume that even a really badly designed implementation would
> use a data structure far more amenable to searches like a binary
> tree of some sort.

The way that the TinyMUD based servers do this (they have a global
object list) is that they have a global 'struct object *db'.  This
struct is allocated to the size of the 'struct object' times the
number of objects in the db.  One accesses an object with 'db[1234]',
for example, to access object #1234.  There is no linear searching
involved in normal object access.  In the case of searching for an
object based on a certain property value, one would have to do a
linear search.. but that is only done by an administrator looking for
loose objects, and done rarely at that.

> The only time I would think that a pure linear traversal would be
> necessary is if you had to touch all items, e.g. for storage to
> disk.

Brian is correct, in the case of Tiny derivatives--setting aside the
matter of searches.

Nick Walker

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list