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

Function i64_compression_ratio

nodedb-codec/src/pcodec.rs:200–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

198
199 #[test]
200 fn i64_compression_ratio() {
201 let values: Vec<i64> = (0..10_000)
202 .map(|i| 1_700_000_000_000 + i * 10_000)
203 .collect();
204 let encoded = encode_i64(&values).unwrap();
205 let raw_size = values.len() * 8;
206 let ratio = raw_size as f64 / encoded.len() as f64;
207 assert!(
208 ratio > 2.0,
209 "pcodec should compress monotonic i64 >2x, got {ratio:.2}x"
210 );
211 }
212
213 #[test]
214 fn f64_special_values() {

Callers

nothing calls this directly

Calls 3

encode_i64Function · 0.85
collectMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected