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

Function compression_vs_raw

nodedb-codec/src/fastlanes/mod.rs:391–399  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389
390 #[test]
391 fn compression_vs_raw() {
392 let values: Vec<i64> = (0..10_000)
393 .map(|i| 1_700_000_000_000 + i * 10_000)
394 .collect();
395 let encoded = encode(&values);
396 let raw_size = values.len() * 8;
397 let ratio = raw_size as f64 / encoded.len() as f64;
398 assert!(ratio > 2.0, "expected >2x compression, got {ratio:.1}x");
399 }
400
401 #[test]
402 fn bit_width_calculation() {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.80
encodeFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected