the-cold-dark / genesis

The Cold server - This implements a dynamic, object-oriented language on top of an object database, well suited for virtual environments and online servers (like games).
29 stars 7 forks source link

GDBM lookup can learn from BDB lookup #13

Closed waywardmonkeys closed 1 year ago

waywardmonkeys commented 1 year ago

The GDBM lookup code (lookup.c) does string operations to store the size and offset as formatted string data, while the BDB (lookup_bdb.c) stores them as a binary struct.

Storing the binary struct is more efficient as it avoids calls to atol or atoll which ends up calling into even heavier libc stuff.

(This won't help TEC since it uses BDB.)

waywardmonkeys commented 1 year ago

This was handled in bfc2e3c7dbe1fc25510a2a1eb2cecdb1de1fae68. I think it is sufficient for now, especially as I hope to add an LMDB-backed lookup.