[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

18969: Re: [MUD-Dev] Re: TECH: Distributed Muds

[Full Header] [Plain Text]
From: Nick Walker <nick@geekspace.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Wed, 25 Apr 2001 00:05:02 -0400 (EDT)
References: [1]
Organization: Kanga.Nu
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@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev