Re: [CODE] memory usage

From: Peter Ajamian (pajamian@cheapsam.com)
Date: 09/07/99


Chris Gilbert wrote:

> Hi,
>
> I've pondered compressing the text as
> it loads in, and then uncompressing it as it's needed, but I don't think
> it'll give a great saving in real usage.

Actually I believe you will get a great savings by doing this, probably on a
compression ratio of 4:1, to see how much memory you can save by compressing
the contents of the world files in memory try a little experiment...

from the lib directory type in the following two commands in a row...

tar -cvf wldfiles.tar world
tar -cfzv wldfiles.tar.gz world

you will end up with two files, each containing all your world files in an
archive.  One will be compressed and one will not, simply look at the
difference in size between the two and you will have a pretty good indicator
of what kind of memory savings you can get by compressing the data in
memory.  As for how to actually accomplish the compression, I would
recommend compressing the data whenever a builder changes it, and
uncompressing for use, leave the data compressed in the files also, may as
well save some disk space while you're at it.  Of course you would have to
write a utility to compress the existing files but that shouldn't be too
hard.

Sorry I don't have any code to share with you, but this should be enough to
get you off to a decent start.

Best Wishes,

Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST