diff --git a/crates/loro-core/examples/test.rs b/crates/loro-core/examples/test.rs index 553cc52b..8cd9eba6 100644 --- a/crates/loro-core/examples/test.rs +++ b/crates/loro-core/examples/test.rs @@ -7,7 +7,7 @@ fn main() { use crdt_list::test::Action::*; use loro_core::container::text::tracker::yata::YataImpl; let mut actions = vec![]; - for i in 0..10000_usize { + for i in 0..500_usize { actions.push(if i % 2 == 0 { NewOp { client_id: i as u8, @@ -22,6 +22,9 @@ fn main() { }) } - test::test_with_actions::(5, 100, actions); + for _ in 0..1000 { + test::test_with_actions::(5, 100, actions.clone()); + } + println!("HAHA"); } diff --git a/crates/loro-core/justfile b/crates/loro-core/justfile index 164a1fb4..3598ca70 100644 --- a/crates/loro-core/justfile +++ b/crates/loro-core/justfile @@ -16,3 +16,9 @@ deny: crev: cargo crev crate check + +fuzz: + cargo fuzz run yata -- -max_total_time=60 + +flame: + cargo flamegraph --example test --features=fuzzing --root diff --git a/crates/loro-core/src/container/text/tracker/content_map.rs b/crates/loro-core/src/container/text/tracker/content_map.rs index 63ec1383..17a7d2b3 100644 --- a/crates/loro-core/src/container/text/tracker/content_map.rs +++ b/crates/loro-core/src/container/text/tracker/content_map.rs @@ -5,10 +5,7 @@ use rle::{ HasLength, RleTree, RleVec, }; -use crate::{ - id::{Counter, ID}, - span::IdSpan, -}; +use crate::{id::ID, span::IdSpan}; use super::y_span::{StatusChange, YSpan, YSpanTreeTrait};