[MUD-Dev] Re: Persistant storage.... My current idea.

J C Lawrence claw at under.engr.sgi.com
Wed Apr 22 16:28:49 New Zealand Standard Time 1998


Date: Sun, 5 Apr 98 09:03:38 MST
Message-Id: <9804051603.8wb5 at ami-cg.GraySage.Edmonton.AB.CA>
From: cg at ami-cg.GraySage.Edmonton.AB.CA (Chris Gray)
To: cynbe at muq.org
Cc: claw at under.engr.sgi.com
Subject: Re: [MUD-Dev] Persistant storage.... My current idea.

[Had you meant this to not be going back to the MUD-Dev list?]
:cg at ami-cg.GraySage.Edmonton.AB.CA (Chris Gray):
:
:| If you keep an index table in memory all the time, then there will also
:| be no more than one disk read to get any DB entry.
:| [...] After a few header words, index file is an array of small
:| structs, containing a 16 bit slot length, a 16 bit 'used' length, and
:| a 32 bit file offset.
:
:True, but if ram is cheap, why use disk-basing at all? :)

In my case, the index file is usually quite a bit smaller than the full
database file.

:What's your average object size?

I just went and checked the 3 scenario's I have available:

       which        DB      index   ratio
    -------------------------------------
    main world   611680     49764    12.2
      castle     150004     17660     8.5
      simple       5772       716     8.1

'main world' has about 30K source lines, and includes 6 quests, combat,
on-line building, etc. 'castle' is just a graphical overhead view castle,
with no actual game-play, of a 100+ room castle on 7 levels. 'simple' is
a minimal, but playable scenario that I use as a learning example.

Small strings tend not to be duplicated, since they are either in the
world code, or are attached to model objects and inherited. The DB also
holds all of the MUD code, in a linearized parse-tree form, along with
symbol tables to hold everything, and both of those can get large.

:I presume your scheme works well with your design, but with many
:systems, statistics show an average object size of 13-16 bytes.

I looks like mine would average nearly 100 bytes.

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

--
J C Lawrence                               Internet: claw at null.net
(Contractor)                               Internet: coder at ibm.net
---------(*)                     Internet: claw at under.engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...

--
MUD-Dev: Advancing an unrealised future.



More information about the MUD-Dev mailing list