Speed up packet dedup and fix benches (#22592)
* Speed up packet dedup and fix benches * fix tests * allow int arithmetic in bench
This commit is contained in:
@ -426,12 +426,11 @@ fn dedup_packet(count: &AtomicU64, packet: &mut Packet, bloom: &AtomicBloom<&[u8
|
||||
return;
|
||||
}
|
||||
|
||||
if bloom.contains(&packet.data.as_slice()) {
|
||||
// If this packet was not newly added, it's a dup and should be discarded
|
||||
if !bloom.add(&&packet.data.as_slice()[0..packet.meta.size]) {
|
||||
packet.meta.set_discard(true);
|
||||
count.fetch_add(1, Ordering::Relaxed);
|
||||
return;
|
||||
}
|
||||
bloom.add(&packet.data.as_slice());
|
||||
}
|
||||
|
||||
pub fn dedup_packets(bloom: &AtomicBloom<&[u8]>, batches: &mut [PacketBatch]) -> u64 {
|
||||
|
Reference in New Issue
Block a user