perf: improve text checkout scalability#956
Conversation
|
Benchmark / validation update after the TMP_PLAN cleanup. Fixed-size checkout bench command shape: LORO_TEXT_CHECKOUT_PROFILE=1 LORO_TEXT_CHECKOUT_PEERS=1000 LORO_TEXT_CHECKOUT_BASE_LEN=1024 LORO_TEXT_CHECKOUT_CHANGES=1000 cargo bench -p loro-internal --features test_utils --bench text_checkout -- <case> --warm-up-time 0.05 --measurement-time 0.1 --sample-size 10Results:
Phase 5 cost note: after the same-parent fast path, future sibling scanning is no longer the dominant cost in the measured 1000-peer cases. It is still visible in the worst same-position case (~0.57 ms, about 3-4% of total), but the remaining slow path is mostly replay/diff_calc. For subscribed rich overlap marks, future_scan is negligible (~31 us), while state apply and diff calc dominate. Additional validation now passed: cargo fuzz run text-update -- -max_total_time=60
cargo fuzz run all -- -max_total_time=60Both fuzz targets completed their 60s runs without crashes. The fuzz lockfile refresh was discarded because it was generated by the local run and is unrelated to this PR. |
|
Follow-up phase 4 update after continuing the 1-4 plan. Added commit
Validation passed after this commit: cargo check -p loro-internal --features test_utils
cargo test -p loro-internal richtext --features test_utils
cargo test -p loro-internal checkout --features test_utils
cargo test -p loro-internal import --features test_utils
cargo test -p fuzz random_fuzz_1s -- --nocapture
git diff --checkAffected bench rerun: LORO_TEXT_CHECKOUT_PROFILE=1 LORO_TEXT_CHECKOUT_PEERS=1000 LORO_TEXT_CHECKOUT_BASE_LEN=1024 LORO_TEXT_CHECKOUT_CHANGES=1000 cargo bench -p loro-internal --features test_utils --bench text_checkout -- rich/overlap-mark-peer-checkout/subscribed --warm-up-time 0.05 --measurement-time 0.1 --sample-size 10Result: Criterion range |
|
Fuzz validation for the text checkout performance PR:
No crashes, panics, sanitizer failures, or reproducer artifacts were reported. Workspace was clean after restoring the fuzz-generated |
…out-perf # Conflicts: # crates/loro-internal/src/loro.rs # crates/loro-internal/src/oplog.rs
WASM Size Report
|
Summary
Benchmarks
Validation
cargo check -p loro-internal --features test_utils --bench text_checkoutcargo test -p loro-internal crdt_rope::test --features test_utilscargo test -p loro-internal checkout --features test_utilscargo test -p loro-internal richtext --features test_utilscargo test -p loro-internal import --features test_utilscargo check -p loro-internalcargo test -p fuzz random_fuzz_1s -- --nocapturecargo test -p fuzz update_text -- --nocapturegit diff --checkNotes
TMP_PLAN.mdis intentionally not included in this PR.