loro/crates/loro-internal/examples/automerge_x100.rs
Zixuan Chen 1e736df133
Refactor: rm legacy code (#97)
* 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
2023-07-31 11:49:55 +08:00

21 lines
652 B
Rust

use loro_internal::LoroDoc;
fn main() {
use bench_utils::TextAction;
use std::time::Instant;
let actions = bench_utils::get_automerge_actions();
let loro = LoroDoc::default();
let start = Instant::now();
// loro.subscribe_deep(Box::new(|_| ()));
let text = loro.get_text("text");
for _ in 0..1 {
for TextAction { del, ins, pos } in actions.iter() {
let mut txn = loro.txn().unwrap();
text.delete_utf16(&mut txn, *pos, *del).unwrap();
text.insert_utf16(&mut txn, *pos, ins).unwrap();
}
}
// loro.diagnose();
println!("{}", start.elapsed().as_millis());
}