布隆过滤器或杜鹃散列? [英] Bloom filter or cuckoo hashing?

查看:286
本文介绍了布隆过滤器或杜鹃散列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪你preFER,为什么?

Which do you prefer and why?

他们都可以被用来完成类似的任务,但我很好奇,看什么人用在实际的应用程序和他们的理由这样做。

They both can be used to accomplish similar tasks but I'm curious as to see what people have used in actual applications and their reasoning for doing so.

推荐答案

哪你preFER,葡萄酒和奶酪?

Which do you prefer, wine or cheese?

A 布隆过滤器是当你有空间有限 高的查询成本大多是负面的查询 。照片 在这种情况下,一个布隆过滤器 8位每个键 4的散列函数为您提供 2.5%的假阳性率;您处理查询近更快的 40倍比以前,在成本每个键 1个字节

A bloom filter is for when you have limited space, high query cost, and mostly negative queries.
In that case, a bloom filter with 8 bits per key and 4 hash functions gives you 2.5% false positive rate; you process queries nearly 40 times faster than before, at the cost of 1 byte per key.

在另一方面,如果有任何的 previous条件不成立,一个哈希表作为缓存是有道理的,但它显然将采取一个大量的每个条目超过一个字节: - )

On the other hand, if any of the previous conditions do not hold, a hash table acting as a cache makes sense, though it obviously will take a lot more than one byte per entry :-)

您甚至可以跳过的杜鹃硬边的情况下散列如果这是一个高速缓存。这也使得杜鹃哈希表(或任何东西比线性哈希等)没有实际意义。

You can even skip over the hard edge cases of cuckoo hashing if it's a cache. That also makes the size-increase problems of cuckoo hash tables (or anything other than linear hash) moot.

这篇关于布隆过滤器或杜鹃散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆