piskvorky / bounter

Efficient Counter that uses a limited (bounded) amount of memory regardless of data size.
MIT License
934 stars 47 forks source link

HashTable: improve storing strings on the heap #14

Open isamaru opened 6 years ago

isamaru commented 6 years ago

Currently, each string stored in the hashtable is allocated on the regular heap with its own malloc, which suffers from additional memory overhead (bookkeeping data + padding). This overhead can increase the heap size by 50-100 %. Writing own heap for strings could make this a little bit more memory-efficient and maybe a little faster.