Re: ASCII vs. Binary pfiles

From: Chris Maniar (rafo@kulthea.stacken.kth.se)
Date: 04/04/01


On Wed, 4 Apr 2001, Mike Breuer wrote:

> Anyone want to comment on this one?  ASCII vs. binary pfiles.  I am
> probably in the minority, but I tend to prefer binary because (AFAIK)
> they load in faster and easier (no parsing necessary).  Also, there is a
> space consideration with ASCII which takes up lots more room plus wastes

Lets add something to the discussion here... how about ASCII vs Binary vs
SQL playerfiles. I have a CircleMUD (my old mud) which I converted to use
MySQL for almost everything, and a DikuMUD which I'm working on converting
over. I dont think any of the 3 formats are the "best". Each one has
advantages and disadvantages over the others. Whats best is relative to
what your needs and resources are.

You cited two problems you have with ASCII pfiles - loading times and
space considerations. My CircleMUD was running on a dedicated box with
dual p2 processors, a 20gb (I think) scsi disk and 256mbs ram. Loading
times and space simply wasn't an issue. I could do a copyover reboot in 4
seconds. I used to have ASCII pfiles before I switched over to SQL, but
there wasn't a noticable speed increase in switching over. However, having
everything in an SQL table made it a lot easier to access from other
applications, and especially from the web. My helpfiles could be edited
and viewed on the web through relatively simple PHP scripts. With ASCII,
this would have involved writing a parser, and binary would have been even
more complicated.

Now, the DikuMUD is more complicated. Its running on a 200mhz box with
128mbs ram. Its a lot bigger (in every sense) than the CircleMUD. When we
transferred the world files to SQL, there was a very noticable speed
increase in the boot up time. However, as I've been working on changing
the playerfiles to SQL, I've noticed that the machine just may not be fast
enough to handle it. Since each array and structure in the pfile has to
have its own table, the database ERD is beginning to look very
complicated - possibly too complicated to be worth it. The mud would have
to cross-reference all these tables to load a player, and I don't believe
the machine can handle that.

Er.. so to summarise the whole email:
if (host.memory && host.space && host.processor >= BIG)
 playerfiles = SQL;
else if (host.memory && host.space && host.processor >= MEDIUM)
 playerfiles = ASCII;
else
 playerfiles = BINARY;

:)

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST