hashtable - looking for hash table C library -


i did check previous questions on topic couldn't find solution meets need.

what need:

  1. supports both strings, , integer tuples (int arrays in c). if it's integer array, length fixed @ compile time.

  2. fast.

  3. memory efficient. need use process super large data sets.

  4. the capacity of hash tables grow dynamically. growth of size of hash tables handled library, instead of me.

  5. i need create large number of such hash tables. , these hash tables linked tree, in values in 1 hash table point other hash tables.

my application both memory , cpu bound. -- how lucky am! :)

i don't consider c++ implementations now, unless couldn't find solution in c.

thanks!

what uthash - a hash table c structures.

  • supports both strings, , integer tuples

uthash has no restriction vs. keys: key , structure can have any data type.

it includes default macros hash common key types, namely integer , strings. in addition provides generic macros (hash_add , hash_find) support any data type.

  • fast

it sounds to be:

add, find , delete constant-time operations. [...] hash aims minimalistic , efficient. it’s around 900 lines of c.

  • memory efficient

more details here:

the hash handle consumes 32 bytes per item on 32-bit system, or 56 bytes per item on 64-bit system. other overhead costs-- buckets , table-- negligible in comparison.

  • the capacity of hash tables grow dynamically

it supported out-of-the-box:

bucket expansion occurs automatically , invisibly needed. there no need application know when occurs.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -