dryman / opic

Fast serialization framework for C
GNU Lesser General Public License v3.0
225 stars 21 forks source link

pure in memory PascalHashTable #81

Open amosbird opened 5 years ago

amosbird commented 5 years ago

Does it make sense to support non-disk backed hash tables?

    PascalHashTable* table = PHNew(NULL,
        2000000, // table size: 20 elements
        0.7, // table load: 70%
        10, // inline size for key
        sizeof(data)); // value size
amosbird commented 5 years ago

I just did some tests with shm backed hash tables. https://la.wentropy.com/hI-L

The fixed key sized hash table consumes the same amount RSS as unordered_map while variant key sized hash table doubles the memory consumption. Both hash tables are 3 times slower than unordered_map when doing insertion.

Is that a fair benchmark? What benefits can I get for using opic hash tables in memory only?