mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
fix the comments of test bitmap (#1516)
This commit is contained in:
parent
dca0d52dcd
commit
1db1a02934
1 changed files with 4 additions and 4 deletions
|
@ -57,8 +57,8 @@ fn test_a_small_bitmap() {
|
||||||
let serialized_buffer = bitmap.serialize();
|
let serialized_buffer = bitmap.serialize();
|
||||||
|
|
||||||
// we can store 3 pos in a roaring bitmap in 22 bytes
|
// we can store 3 pos in a roaring bitmap in 22 bytes
|
||||||
// this is compared to storing them as a vec of u64 values which would be 8 * 3
|
// this is compared to storing them as a vec of u32 values which would be 4 * 3
|
||||||
// = 32 bytes
|
// = 12 bytes
|
||||||
assert_eq!(serialized_buffer.len(), 22);
|
assert_eq!(serialized_buffer.len(), 22);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ fn test_a_big_bitmap() {
|
||||||
let mut bitmap: Bitmap = (1..1_000_000).collect();
|
let mut bitmap: Bitmap = (1..1_000_000).collect();
|
||||||
let serialized_buffer = bitmap.serialize();
|
let serialized_buffer = bitmap.serialize();
|
||||||
|
|
||||||
// we can also store 1,000 pos in 2,014 bytes
|
// we can also store 1,000,000 pos in 131,208 bytes
|
||||||
// a vec of u64s here would be 8,000 bytes
|
// a vec of u32s here would be 4,000,000 bytes
|
||||||
assert_eq!(serialized_buffer.len(), 131_208);
|
assert_eq!(serialized_buffer.len(), 131_208);
|
||||||
|
|
||||||
// but note we can optimize this heavily to get down to 230 bytes...
|
// but note we can optimize this heavily to get down to 230 bytes...
|
||||||
|
|
Loading…
Reference in a new issue