Skip to content
Browse files

Merge pull request #14 from eriksoe/bloom-performance-fix

Bloom filter: Have only one level when using large sparse array.
  • Loading branch information...
2 parents adab955 + f978f56 commit 4592bc000bc0d2e9cbb222546b4f3ae2df9181b1 @krestenkrab krestenkrab committed Sep 25, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/hanoidb_bloom.erl
View
5 src/hanoidb_bloom.erl
@@ -71,7 +71,10 @@ bloom(N, E) when is_number(N), N >= 0,
bloom(bits, 32, E).
bloom(Mode, N, E) ->
- K = 1 + trunc(log2(1/E)),
+ K = case Mode of
+ size -> 1 + trunc(log2(1/E));
+ bits -> 1
+ end,
P = pow(E, 1 / K),
Mb =

0 comments on commit 4592bc0

Please sign in to comment.
Something went wrong with that request. Please try again.