mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-06 20:43:24 +00:00
6311782943
but no cap for now
12 lines
522 B
Rust
12 lines
522 B
Rust
use compact_bytes::CompactBytes;
|
|
|
|
pub fn main() {
|
|
let data = include_str!("../benches/permuted.mht");
|
|
// this simulate the situation in loro snapshot encoding,
|
|
// where we first encode the state snapshot, then we look up the slices of the ops.
|
|
let mut bytes = CompactBytes::new();
|
|
bytes.append(&data.as_bytes()[..data.len() / 2]);
|
|
println!("{}", bytes.as_bytes().len()); // 114275
|
|
bytes.alloc_advance(&data.as_bytes()[data.len() / 2..]);
|
|
println!("{}", bytes.as_bytes().len()); // 117026
|
|
}
|