chore: bench utils

This commit is contained in:
Zixuan Chen 2022-10-13 14:49:58 +08:00
parent f760aad046
commit 506350a45a
3 changed files with 12 additions and 6 deletions

View file

@ -7,7 +7,7 @@ fn main() {
use crdt_list::test::Action::*; use crdt_list::test::Action::*;
use loro_core::container::text::tracker::yata::YataImpl; use loro_core::container::text::tracker::yata::YataImpl;
let mut actions = vec![]; let mut actions = vec![];
for i in 0..10000_usize { for i in 0..500_usize {
actions.push(if i % 2 == 0 { actions.push(if i % 2 == 0 {
NewOp { NewOp {
client_id: i as u8, client_id: i as u8,
@ -22,6 +22,9 @@ fn main() {
}) })
} }
test::test_with_actions::<YataImpl>(5, 100, actions); for _ in 0..1000 {
test::test_with_actions::<YataImpl>(5, 100, actions.clone());
}
println!("HAHA"); println!("HAHA");
} }

View file

@ -16,3 +16,9 @@ deny:
crev: crev:
cargo crev crate check cargo crev crate check
fuzz:
cargo fuzz run yata -- -max_total_time=60
flame:
cargo flamegraph --example test --features=fuzzing --root

View file

@ -5,10 +5,7 @@ use rle::{
HasLength, RleTree, RleVec, HasLength, RleTree, RleVec,
}; };
use crate::{ use crate::{id::ID, span::IdSpan};
id::{Counter, ID},
span::IdSpan,
};
use super::y_span::{StatusChange, YSpan, YSpanTreeTrait}; use super::y_span::{StatusChange, YSpan, YSpanTreeTrait};