PHastR:采用旋转布局的更快最小完美哈希
PHastR: Faster Minimal Perfect Hashing with Rotated Layouts
AI总结:
该研究提出PHastR最小完美哈希函数,通过旋转布局避免自碰撞,空间与PHast+相当,构建和查询速度更快,多线程扩展性更好,还推导了键放置碰撞比例的下界。
摘要:
我们提出了PHastR,它是PHast家族的一种最小完美哈希函数。与PHast的快速构建变体PHast+类似,PHastR通过位并行操作寻找可行的种子:其种子将键沿槽环移动,为了评估桶的种子,它会对每个键循环移位一个记录其环中哪些槽被使用的字。然而,与PHast+不同,它避免了自碰撞,自碰撞是指一个桶中的两个键对其(几乎)所有种子都发生碰撞:带有环绕和乘数3的PHast+所碰撞的桶中,超过三分之一包含这种情况。使用8位种子时,PHastR每个键占用1.94位,与带有环绕的PHast+最佳变体的空间相同,但它的构建时间仅为PHast+的37%,在10^9个键上的查询速度快28%,因为它仅碰撞0.5%的键,而PHast+碰撞3.9%;其查询速度也比PHast更快,PHast的构建时间是其11倍,查询速度与PtrHash相当,而PtrHash每个键多占用超过1位。当预期桶大小更大时,PHastR的空间与PHast仅相差0.02位/键,为1.90位/键,且查询速度仍然更快。其构建在多线程下的扩展性也更好:在48核机器的所有线程上,它的构建速度几乎是PHast+的3倍。最后,我们指出,当每个键只能放置在W个槽的范围内时,对于n个随机键在n个槽上的任何放置方式,无论如何找到,在大型键集上必然会碰撞恒定比例的键:我们得出该比例的下界约为0.1/W,并且估计最佳放置方式碰撞约1/2W的键,这大约是PHastR碰撞比例的十分之一。
英文摘要:
We present PHastR, a minimal perfect hash function of the PHast family. Like PHast+, the fast-to-build variant of PHast, PHastR finds feasible seeds with bit-parallel operations: its seeds move keys along rings of slots, and to evaluate the seeds of a bucket it cyclically shifts, for each key, a word recording which slots of its ring are used. Unlike PHast+, however, it is almost immune to self-collisions, which make two keys of a bucket collide for (almost) all its seeds: more than a third of the buckets bumped by PHast+ with wrapping and multiplier 3 contain one. With 8-bit seeds, PHastR uses $1.94$ bits per key, essentially the same space as the best variant of PHast+ with wrapping, but it is built in $38\%$ of the time, and its queries are $34\%$ faster on $10^9$ keys, as it bumps $0.5\%$ of the keys instead of $3.9\%$; they are faster also than those of PHast, which takes twelve times as long to build, and than those of PtrHash, which uses more than one bit per key more. With a larger expected bucket size PHastR comes within $0.02$ bits per key of the space of PHast, using $1.90$ bits per key, and its queries are still about as fast. Its construction also scales better with the number of threads: with all the threads of a 96-core machine it is two and a half times faster than that of PHast+. An offline construction built PHastR on a trillion keys in $9.3$ hours on a single machine. Finally, we argue that when each key can be placed only within a range of $W$ slots, every placement of $n$ random keys on $n$ slots, however found, must bump on large key sets a constant fraction of the keys: we derive an asymptotic lower bound of about $0.1/W$ on the expected value of this fraction, and we prove that, in a Poisson model, the best placement bumps about $1/2W$ of the keys, which is about one tenth of the keys bumped by PHastR.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。