mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
Remove unnessary check
The call to Empty() was originally meant as an optimization in the lookup phase. However, the performance implications are substantial: this check operates in O(f(m/8)) where m is the number of bits in the Bloom filters and f a function that looks for the first non-empty block of bits. As the Bloom filter fills up, the check for Empty() becomes no longer negligible and can lead to serious performance degradations when Bloom filters are used frequently.
This commit is contained in:
parent
c1f02aaa61
commit
74c6b9f54c
1 changed files with 0 additions and 3 deletions
|
@ -173,9 +173,6 @@ function bloomfilter_lookup%(bf: opaque of bloomfilter, x: any%): count
|
|||
%{
|
||||
const BloomFilterVal* bfv = static_cast<const BloomFilterVal*>(bf);
|
||||
|
||||
if ( bfv->Empty() )
|
||||
return new Val(0, TYPE_COUNT);
|
||||
|
||||
if ( ! bfv->Type() )
|
||||
reporter->Error("cannot perform lookup on untyped Bloom filter");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue