Skip to content

Commit 864b5ca

Browse files
authored
perf(loro-internal): remove quadratic slow paths in text import/checkout (#893)
* perf: opt step 1 * perf(loro-internal): speed up InsertText slicing during change split - Add ASCII/suffix fast paths in InnerListOp::slice to avoid O(n^2) unicode->byte scans - Add ignored perf test reproducing split-suffix slicing pattern * perf(loro-internal): batch id_to_cursor updates on richtext leaf splits - Batch leaf-split remaps via IdToCursor::update_insert_batch to reduce per-split InsertSet::update churn. - Add InsertSet::update_many fast-path for small fragments (<= MAX_FRAGMENT_LEN) by rebuilding runs from a dense map. - Ignore .trace_analysis/ artifacts. * fix: a failed fuzzing test * perf(loro-internal): optimize fast path for plain-text deltas in richtext state - Introduced a new method `content_node_len` to retrieve the length of content nodes. - Enhanced the logic for determining when to apply fast updates for plain-text deltas, reducing unnecessary rebuilds. - Improved performance by minimizing BTree mutations during incremental updates. * chore: changeset
1 parent a34134d commit 864b5ca

File tree

12 files changed

+969
-285
lines changed

12 files changed

+969
-285
lines changed

.changeset/big-suns-share.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"loro-crdt": patch
3+
"loro-crdt-map": patch
4+
---
5+
6+
perf(loro-internal): remove quadratic slow paths in text import/checkout #895

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules/
99
.idea/
1010
coverage/
1111
trace-*.json
12+
.trace_analysis/
1213
.loro
1314
loom_test.json
1415
.env

0 commit comments

Comments
 (0)