whio_ht

Not logged in

ACHTUNG: AS OF 20110523, THIS PAGE IS NOW MAINTAINED IN THE NEW WIKI: http://whiki.wanderinghorse.net/wikis/whio/?page=whio_ht

whio_ht: a whio_dev-stored hashtable

Header: <wh/whio/whio_ht.h>

whio_ht is similar to whio_udb, except that the keys and values may have variable lengths (essentially of unbounded size). It has the same overall performance characteristics of whio_udb: insertion, searching, and removal are all amortized O(1). Unlike whio_udb, this implementation has constant memory costs.

whio_ht is highly optimized for low memory usage, and a given instance requires far less than 1000 bytes of dynamically-allocated memory. As a basis for comparison, on my system sizeof(FILE)==216 and fopen() allocates about twice that. That said, in-memory hashtables (using a RAM-based whio_dev as storage) are not memory-light, due to the overhead of holding the various block-level and linking-related information in RAM (but they should be pretty fast).

It might interest one to know that whio_ht is basically a wrapper around a whio_vlbm object, and the VLBM API is used for the underlying block management.

Primary Features

Primary Misfeatures

Some of the more notable TODOs, in no particular order:

Examples

See whio_ht_HOWTO.