mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-22 21:07:43 +00:00
Add compression cmp in size bench (#277)
This commit is contained in:
parent
17571ab6e0
commit
dbf128959d
1 changed files with 8 additions and 5 deletions
|
@ -21,10 +21,13 @@ fn main() {
|
|||
loro.diagnose_size();
|
||||
drop(actions);
|
||||
let start = Instant::now();
|
||||
let mut size = 0;
|
||||
for _ in 0..1 {
|
||||
size = loro.export_snapshot().len();
|
||||
}
|
||||
let snapshot = loro.export_snapshot();
|
||||
println!("Snapshot encoding time {}", start.elapsed().as_millis());
|
||||
println!("Snapshot size {}", size);
|
||||
let compressed = zstd::encode_all(&mut snapshot.as_slice(), 0).unwrap();
|
||||
println!(
|
||||
"Snapshot encoding time including compression {}",
|
||||
start.elapsed().as_millis()
|
||||
);
|
||||
println!("Snapshot size {}", snapshot.len());
|
||||
println!("Snapshot size after compression {}", compressed.len());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue