2022-12-12 17:39:57 +00:00
|
|
|
use std::time::Instant;
|
|
|
|
|
2023-07-31 03:49:55 +00:00
|
|
|
use loro_internal::{LoroDoc, LoroValue};
|
2022-12-12 17:39:57 +00:00
|
|
|
// #[global_allocator]
|
|
|
|
// static ALLOC: dhat::Alloc = dhat::Alloc;
|
2022-12-08 15:02:44 +00:00
|
|
|
|
|
|
|
fn main() {
|
2022-12-12 17:39:57 +00:00
|
|
|
let start = Instant::now();
|
|
|
|
// let profiler = dhat::Profiler::builder().trim_backtraces(None).build();
|
2023-07-31 03:49:55 +00:00
|
|
|
let mut actors: Vec<_> = (0..1540).map(|_| LoroDoc::default()).collect();
|
2022-12-12 17:39:57 +00:00
|
|
|
let mut updates: Vec<Vec<u8>> = Vec::new();
|
2022-12-08 15:02:44 +00:00
|
|
|
for (i, actor) in actors.iter_mut().enumerate() {
|
2023-07-31 03:49:55 +00:00
|
|
|
let list = actor.get_list("list");
|
2022-12-08 15:02:44 +00:00
|
|
|
let value: LoroValue = i.to_string().into();
|
2023-07-31 03:49:55 +00:00
|
|
|
let mut txn = actor.txn().unwrap();
|
|
|
|
list.insert(&mut txn, 0, value).unwrap();
|
|
|
|
updates.push(actor.export_from(&Default::default()));
|
2022-12-08 15:02:44 +00:00
|
|
|
}
|
|
|
|
|
2022-12-12 17:39:57 +00:00
|
|
|
// drop(profiler);
|
|
|
|
println!("{}", start.elapsed().as_millis());
|
2023-07-31 03:49:55 +00:00
|
|
|
|
|
|
|
todo!();
|
|
|
|
// actors[0].decode_batch(&updates).unwrap();
|
2022-12-08 15:02:44 +00:00
|
|
|
}
|