TinyMUSH 3.3
TinyMUSH Server
Loading...
Searching...
No Matches
Functions
udb_obj.c File Reference

Binary object handling gear. More...

#include "config.h"
#include "constants.h"
#include "typedefs.h"
#include "macros.h"
#include "externs.h"
#include "prototypes.h"
#include <string.h>
Include dependency graph for udb_obj.c:

Functions

UDB_OBJECTunroll_obj (char *data)
 
char * rollup_obj (UDB_OBJECT *o)
 
int obj_siz (UDB_OBJECT *o)
 
void objfree (UDB_OBJECT *o)
 
char * obj_get_attrib (int anam, UDB_OBJECT *obj)
 
void obj_set_attrib (int anam, UDB_OBJECT *obj, char *value)
 
void obj_del_attrib (int anam, UDB_OBJECT *obj)
 
UDB_OBJECTget_free_objpipe (unsigned int obj)
 
char * pipe_get_attrib (int anum, unsigned int obj)
 
void pipe_set_attrib (int anum, unsigned int obj, char *value)
 
void pipe_del_attrib (int anum, unsigned int obj)
 
void attrib_sync (void)
 

Detailed Description

Binary object handling gear.

Author
TinyMUSH development team (https://github.com/TinyMUSH)
Version
3.3
Date
2021-01-04
Note
Why not just write the attributes individually to disk? Well, when you're running on a platform that does synchronous writes with a large database, thousands of I/O operations tend to be expensive. When you 'coalesce' many attribute writes onto a single object and do only one I/O operation, you can get an order of magnitude speed difference, especially on loading/unloading to flatfile. It also has the side effect of pre-fetching on reads, since you often have sequential attribute reads off of the same object.

Wile all of this is extremely true, keep in mind that text was written over 25 years ago. Even if we didn't optimized our read/write sequence you woudn't see the difference.

If you really want to see the difference, it's time to get youself into the retro-computing scene :)