mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 13:39:12 +00:00
c105ff2220
* feat: checkout to frontiers * feat: record timestamp * fix: use unicode len by default for text now "你好" has length of 2 instead of 6 * chore: rm dbg!
22 lines
687 B
Rust
22 lines
687 B
Rust
use std::time::Instant;
|
|
// #[global_allocator]
|
|
// static ALLOC: dhat::Alloc = dhat::Alloc;
|
|
|
|
use loro_internal::LoroDoc;
|
|
|
|
fn main() {
|
|
// let p = dhat::Profiler::builder().trim_backtraces(None).build();
|
|
let start = Instant::now();
|
|
let actor = LoroDoc::default();
|
|
let mut output = Vec::new();
|
|
let list = actor.get_list("list");
|
|
let mut last_vv = actor.oplog_vv();
|
|
for i in 0..10000 {
|
|
let mut txn = actor.txn().unwrap();
|
|
list.insert(&mut txn, i, i.to_string().into()).unwrap();
|
|
output.push(actor.export_from(&last_vv.clone()));
|
|
last_vv = actor.oplog_vv();
|
|
}
|
|
println!("{} ms", start.elapsed().as_millis());
|
|
// drop(p)
|
|
}
|