2022-12-12 05:44:49 +00:00
|
|
|
use std::time::Instant;
|
|
|
|
// #[global_allocator]
|
|
|
|
// static ALLOC: dhat::Alloc = dhat::Alloc;
|
|
|
|
|
2023-01-16 10:44:19 +00:00
|
|
|
use loro_internal::LoroCore;
|
2022-12-12 05:44:49 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// let p = dhat::Profiler::builder().trim_backtraces(None).build();
|
|
|
|
let start = Instant::now();
|
|
|
|
let mut actor = LoroCore::default();
|
|
|
|
let mut output = Vec::new();
|
|
|
|
let mut list = actor.get_list("list");
|
2022-12-27 04:57:16 +00:00
|
|
|
let mut last_vv = actor.vv_cloned();
|
2022-12-12 05:44:49 +00:00
|
|
|
for i in 0..10000 {
|
|
|
|
list.insert(&actor, i, i.to_string()).unwrap();
|
2023-01-16 07:28:10 +00:00
|
|
|
output.push(actor.encode_from(last_vv.clone()));
|
2022-12-27 04:57:16 +00:00
|
|
|
last_vv = actor.vv_cloned();
|
2022-12-12 05:44:49 +00:00
|
|
|
}
|
|
|
|
println!("{} ms", start.elapsed().as_millis());
|
|
|
|
// drop(p)
|
|
|
|
}
|