简体   繁体   English

具有内存限制的系统的哈希表

[英]Hashtable for a system with memory constraints

I have read about the variants of hashtable but it is not clear to me which one is more appropriate for a system that is low on memory (we have a memory constraint limit). 我已经阅读了有关hashtable的变体,但是我不清楚哪一个更适合内存不足的系统(我们有内存限制)。
Linear/Quadratic probing works well for sparse tables. 线性/二次探查适用于稀疏表。
I think Double hashing is the same as Quadratic in this aspect. 在这方面,我认为Double hashing与Quadratic相同。
External chaining does not have issue with clustering. 外部链接对群集没有影响。
Most textbooks I have checked seem to assume that a extra space will always be available but practically in most example implementations I have seen since the hashtable is never halved take much more space than really needed. 我检查过的大多数教科书似乎都假定总是会有额外的空间,但实际上在我见过的大多数示例实现中,因为哈希表永远不会减半,因此会占用比实际需要更多的空间。
So which variant of a hashtable is most efficient when we want to make the best usage of memory? 那么,当我们想充分利用内存时,哈希表的哪个变体最有效?

Update: 更新:
So my question is not only about the size of the buckets. 因此,我的问题不仅在于水桶的大小。 My understanding is that both the size of the buckets and the performance under load is what matters. 我的理解是,铲斗的尺寸负载下的性能都很重要。 Because if the size of the bucket is small but the table degrades on 50% load then this means we need to resize to a larger table often. 因为如果存储桶的大小很小,但是表在50%的负载下会变小,那么这意味着我们需要经常调整到更大的表的大小。

See this variant of Cukoo Hashing . 请参阅Cukoo Hashing的 此变体

This will require from you more hash functions, but, it makes sense - you need to pay something for the memory savings. 这将需要您更多的哈希函数,但是,这很有意义-您需要为节省内存付出一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM