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

Function unpack_simd

nodedb-fts/src/codec/simd_unpack/mod.rs:52–59  ·  view source on GitHub ↗

Unpack a full bitpacked buffer (with 3-byte header) using SIMD.

(buf: &[u8])

Source from the content-addressed store, hash-verified

50
51/// Unpack a full bitpacked buffer (with 3-byte header) using SIMD.
52pub fn unpack_simd(buf: &[u8]) -> Vec<u32> {
53 if buf.len() < 3 {
54 return Vec::new();
55 }
56 let num_values = u16::from_le_bytes([buf[0], buf[1]]) as usize;
57 let bit_width = buf[2];
58 unpack(&buf[3..], bit_width, num_values)
59}
60
61#[cfg(test)]
62mod tests {

Callers 1

Calls 2

unpackFunction · 0.70
lenMethod · 0.45

Tested by 1