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();
|
2022-12-02 06:39:51 +00:00
|
|
|
for _ in 0..100 {
|
2022-12-27 06:18:46 +00:00
|
|
|
let mut text = loro.get_text("text");
|
|
|
|
for TextAction { del, ins, pos } in actions.iter() {
|
|
|
|
text.delete(&loro, *pos, *del).unwrap();
|
|
|
|
text.insert(&loro, *pos, ins).unwrap();
|
2022-12-02 06:39:51 +00:00
|
|
|
}
|
|
|
|
}
|
2022-12-06 08:34:46 +00:00
|
|
|
println!("{}", start.elapsed().as_millis());
|
2022-12-02 06:39:51 +00:00
|
|
|
}
|