mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 13:39:12 +00:00
82b5f8dc90
* perf: remove unused transact field * perf: micro optimization * bench: fix bench * bench: add utf16 bench * chore: refine diagnose * perf: speedup utf16 lookup * perf: use better utf16 len counter * refactor: use js to cast Loro/Transaction * refactor: map and list use __loro and __txn * test: configure ci vitest * chore: ci
19 lines
612 B
Rust
19 lines
612 B
Rust
fn main() {
|
|
use bench_utils::TextAction;
|
|
use loro_internal::LoroCore;
|
|
use std::time::Instant;
|
|
|
|
let actions = bench_utils::get_automerge_actions();
|
|
let mut loro = LoroCore::default();
|
|
let start = Instant::now();
|
|
// loro.subscribe_deep(Box::new(|_| ()));
|
|
let mut text = loro.get_text("text");
|
|
for _ in 0..1 {
|
|
for TextAction { del, ins, pos } in actions.iter() {
|
|
text.delete_utf16(&loro, *pos, *del).unwrap();
|
|
text.insert_utf16(&loro, *pos, ins).unwrap();
|
|
}
|
|
}
|
|
// loro.diagnose();
|
|
println!("{}", start.elapsed().as_millis());
|
|
}
|