mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 13:39:12 +00:00
1e736df133
* refactor: rm legacy code * chore: rm dead code * refactor: mv refactored files outside * refactor: rename files & methods * chore: rm unused deps * fix: compact bytes err * chore: fix ci
25 lines
834 B
Rust
25 lines
834 B
Rust
use std::time::Instant;
|
|
|
|
use loro_internal::{LoroDoc, LoroValue};
|
|
// #[global_allocator]
|
|
// static ALLOC: dhat::Alloc = dhat::Alloc;
|
|
|
|
fn main() {
|
|
let start = Instant::now();
|
|
// let profiler = dhat::Profiler::builder().trim_backtraces(None).build();
|
|
let mut actors: Vec<_> = (0..1540).map(|_| LoroDoc::default()).collect();
|
|
let mut updates: Vec<Vec<u8>> = Vec::new();
|
|
for (i, actor) in actors.iter_mut().enumerate() {
|
|
let list = actor.get_list("list");
|
|
let value: LoroValue = i.to_string().into();
|
|
let mut txn = actor.txn().unwrap();
|
|
list.insert(&mut txn, 0, value).unwrap();
|
|
updates.push(actor.export_from(&Default::default()));
|
|
}
|
|
|
|
// drop(profiler);
|
|
println!("{}", start.elapsed().as_millis());
|
|
|
|
todo!();
|
|
// actors[0].decode_batch(&updates).unwrap();
|
|
}
|