Old DB, much garbage

Submitted by javelin on Mon, 2012-02-13 19:56

OK. I have been trying to make an argument against using an old DB on a game. I'd much rather start fresh. The old DB is 3-4 years old, 15,000 objects. Already, 10,000 objects have been destroyed, leaving about 5,000 actual objects.
This just seems wrong to me. I'd much rather start anew. Is there any technical reasons as to why one doesn't want 10,000 garbage holes in a DB? Possible corruption problems in the future?

2001-Apr-16 10:44am krey

No corruption. But although garbage objects don't take much memory, they do take some, and a game with 10,000 garbage and 5,000 real will be measurable larger, memory-wise, than a game with only 5,000 real.
In fact, because of the way PennMUSH allocates room in the array for objects,
you pay an even worse penalty. PennMUSH preallocates large chunks of this array to make things faster (so it doesn't have to grow the array by one object every time the db goes up by one). By default, any time the db array needs to grow, it doubles. So initially, this game will have 15000 db array slots. If you ever actually reuse all that garbage, the next object created will cause the game to have 30,000 array slots. Contrast this with a game with 5000 non-garbage objects. The next object created brings you to 10,000 array slots, which is still less than the 15,000 you'd start with using the old db.
That said, there are also advantages to reusing old dbs that often outweigh the above for small dbs (such as reusing code that depends on dbrefs, etc.) But for a 15,000 object db, you'll have to decide if your memory is sufficient to make it worthwhile.

2001-Apr-16 8:06pm dunemush