MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / or

Method or

nodedb/src/engine/timeseries/bitmap_index.rs:65–83  ·  view source on GitHub ↗

Bitwise OR of two bitmaps. Dispatches to SIMD (AVX-512/AVX2/NEON) for large bitmaps.

(&self, other: &Bitmap)

Source from the content-addressed store, hash-verified

63 ///
64 /// Dispatches to SIMD (AVX-512/AVX2/NEON) for large bitmaps.
65 pub fn or(&self, other: &Bitmap) -> Bitmap {
66 let max_len = self.len.max(other.len);
67 let max_words = self.bits.len().max(other.bits.len());
68 let mut result = Bitmap::new(max_len);
69 let min_words = self.bits.len().min(other.bits.len());
70 let simd = super::bitmap_simd::ops();
71 (simd.or_slices)(
72 &self.bits[..min_words],
73 &other.bits[..min_words],
74 &mut result.bits[..min_words],
75 );
76 // Copy remaining words from the longer bitmap.
77 if self.bits.len() > min_words {
78 result.bits[min_words..max_words].copy_from_slice(&self.bits[min_words..max_words]);
79 } else if other.bits.len() > min_words {
80 result.bits[min_words..max_words].copy_from_slice(&other.bits[min_words..max_words]);
81 }
82 result
83 }
84
85 /// Count of set bits.
86 pub fn count_ones(&self) -> usize {

Callers 15

inline_cteFunction · 0.45
rewrite_plan_for_sourceFunction · 0.45
pushMethod · 0.45
create_change_streamFunction · 0.45
validate_typeguardFunction · 0.45
build_matchFunction · 0.45
build_insertFunction · 0.45
build_insertFunction · 0.45
build_ingestFunction · 0.45
emit_deferred_eventsMethod · 0.45

Calls 2

opsFunction · 0.85
lenMethod · 0.45

Tested by 1

bitmap_orFunction · 0.36