[DGD] Re: Out of curiosity...

Felix A. Croes felix at dworkin.nl
Mon May 25 22:29:48 CEST 1998


Stephen Schmidt <schmidsj at union.edu> wrote:

> > There is an obscure cost associated with functions in the auto object
> > that are neither static nor private: all such functions have a cost of
> > two bytes a piece in <every> inheriting object's program.  This is also
> > true for non-private functions in all other (i.e. non-auto) objects.
> > Normally, this is not much of a problem.  However, if you were to have
> > 200 such functions in the auto object, every other program in the game
> > but that of the driver object would become 400 bytes larger.
>
> Something else that might or might not be a problem is that (if the
> DGD internals are similar to MudOS internals in this regard, which 
> I don't know) it may increase the time required to look up functions in
> the object.
>[...]

In DGD, the cost for a local function call is always constant, and does
not increase with the number of functions in the object.  There is no
lookup involved.

If call_other() is used, the function is searched in a hash table, which
is still very efficient and which, on average, will not increase with
the number of functions in the object.  If the same function is called
repeatedly with call_other(), the cost of the second and successive
lookups will be minimal.

In short, DGD handles function calls as efficiently as the programming
model of LPC allows it to be.

Dworkin



More information about the DGD mailing list