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

Function checkpoint_size_reasonable

nodedb-spatial/src/persist.rs:385–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383
384 #[test]
385 fn checkpoint_size_reasonable() {
386 let mut tree = RTree::new();
387 for i in 0..1000 {
388 tree.insert(make_entry(i, (i as f64) * 0.01, (i as f64) * 0.01));
389 }
390 let bytes = tree.checkpoint_to_bytes(None).unwrap();
391 // Each entry: id(8) + 4 f64(32) = ~40 bytes + rkyv overhead.
392 // 1000 entries ≈ 40-60KB is reasonable.
393 assert!(
394 bytes.len() < 100_000,
395 "checkpoint too large: {} bytes",
396 bytes.len()
397 );
398 assert!(
399 bytes.len() > 10_000,
400 "checkpoint too small: {} bytes",
401 bytes.len()
402 );
403 }
404
405 #[test]
406 fn golden_header_layout() {

Callers

nothing calls this directly

Calls 3

make_entryFunction · 0.70
insertMethod · 0.45
checkpoint_to_bytesMethod · 0.45

Tested by

no test coverage detected