arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1104.5400cs.DS
收藏

一个改进了内存利用率和插入时间的cuckoo hashing变体

A cuckoo hashing variant with improved memory utilization and insertion time

Ely Porat, Bar Shalem

摘要:

Cuckoo hashing [4]是一种多选择哈希方案,其中每个项目可以放置在多个位置,并且通过将项目移动到其替代位置来解决冲突。在双向布谷鸟哈希的经典实现中,内存被划分为连续的不相交的固定大小的桶。每个项目被散列到两个桶中,并且可以存储在这些桶中的任何位置。参考文献[2]分析了一种变化,其中桶是连续和重叠的。但是,许多系统从辅存中检索相同大小的块(称为页)中的数据。获取页面是一个相对昂贵的过程;但是一旦获取了页面,就可以更快地访问其内容。我们利用这个属性的内存检索,提出了一个变种的布谷鸟哈希纳入以下约束:每个桶必须完全包含在一个页面,但桶不一定是连续的。实验结果表明,这种修改提高了内存利用率,减少了插入一个项目所需的迭代次数。如果每个项目被散列到两个容量为2的桶,页面大小为8,并且每个桶完全包含在单个页面中,则内存利用率在经典的连续不相交桶变体中等于89.71%,在连续重叠桶变体中等于93.78%,并且在我们的新的非连续桶变体中增加到97.46%。当内存利用率为92%时,我们使用广度优先搜索来查找空闲位置,插入新项所需的迭代次数从连续重叠桶变体中的545次大幅减少到我们新的非连续桶变体中的52次。除了经验的结果,我们提出了一个理论上的下限的内存利用率的变化作为页面大小的函数。

英文摘要:

Cuckoo hashing [4] is a multiple choice hashing scheme in which each item can be placed in multiple locations, and collisions are resolved by moving items to their alternative locations. In the classical implementation of two-way cuckoo hashing, the memory is partitioned into contiguous disjoint fixed-size buckets. Each item is hashed to two buckets, and may be stored in any of the positions within those buckets. Ref. [2] analyzed a variation in which the buckets are contiguous and overlap. However, many systems retrieve data from secondary storage in same-size blocks called pages. Fetching a page is a relatively expensive process; but once a page is fetched, its contents can be accessed orders of magnitude faster. We utilize this property of memory retrieval, presenting a variant of cuckoo hashing incorporating the following constraint: each bucket must be fully contained in a single page, but buckets are not necessarily contiguous. Empirical results show that this modification increases memory utilization and decreases the number of iterations required to insert an item. If each item is hashed to two buckets of capacity two, the page size is 8, and each bucket is fully contained in a single page, the memory utilization equals 89.71% in the classical contiguous disjoint bucket variant, 93.78% in the contiguous overlapping bucket variant, and increases to 97.46% in our new non-contiguous bucket variant. When the memory utilization is 92% and we use breadth first search to look for a vacant position, the number of iterations required to insert a new item is dramatically reduced from 545 in the contiguous overlapping buckets variant to 52 in our new non-contiguous bucket variant. In addition to the empirical results, we present a theoretical lower bound on the memory utilization of our variation as a function of the page size.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑