2022-12-02 06:39:51 +00:00
|
|
|
fn main() {
|
2022-12-27 06:18:46 +00:00
|
|
|
use bench_utils::TextAction;
|
2023-01-16 10:44:19 +00:00
|
|
|
use loro_internal::LoroCore;
|
2022-12-27 06:18:46 +00:00
|
|
|
use std::time::Instant;
|
2022-12-02 06:39:51 +00:00
|
|
|
|
2022-12-27 06:18:46 +00:00
|
|
|
let actions = bench_utils::get_automerge_actions();
|
2022-12-02 06:39:51 +00:00
|
|
|
let mut loro = LoroCore::default();
|
2022-12-06 08:34:46 +00:00
|
|
|
let start = Instant::now();
|
2023-04-03 01:29:25 +00:00
|
|
|
// loro.subscribe_deep(Box::new(|_| ()));
|
|
|
|
let mut text = loro.get_text("text");
|
|
|
|
for _ in 0..1 {
|
2022-12-27 06:18:46 +00:00
|
|
|
for TextAction { del, ins, pos } in actions.iter() {
|
2023-04-03 01:29:25 +00:00
|
|
|
text.delete_utf16(&loro, *pos, *del).unwrap();
|
|
|
|
text.insert_utf16(&loro, *pos, ins).unwrap();
|
2022-12-02 06:39:51 +00:00
|
|
|
}
|
|
|
|
}
|
2023-04-03 01:29:25 +00:00
|
|
|
// loro.diagnose();
|
2022-12-06 08:34:46 +00:00
|
|
|
println!("{}", start.elapsed().as_millis());
|
2022-12-02 06:39:51 +00:00
|
|
|
}
|