loro-crdt 1.13.3 → 1.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.13.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 1727258: Improve text insert and snapshot import performance by avoiding duplicate text boundary validation and skipping eager imported change block parsing.
8
+ - 52d8168: Recover two per-operation editing slowdowns regressed since 1.11.
9
+
10
+ Both are constant-factor regressions on the per-op (auto-commit) editing path
11
+ introduced by the lazy-snapshot work in #985, measured against the 1.11.1
12
+ release.
13
+
14
+ 1. Every `MapHandler`/`ListHandler`/`MovableListHandler` insert validated its
15
+ value with `ensure_no_regular_container_value`, which heap-allocated a `Vec`
16
+ on each call even for scalar values (the common case). A scalar fast-path now
17
+ skips the allocation and traversal entirely. `map create 10^4 key`:
18
+ ~19.4ms -> ~10.7ms.
19
+ 2. The per-op text bounds check (`TextHandler::len`/`len_unicode`/`len_utf16`)
20
+ took two `DocState` locks — one to check whether the container state was
21
+ decoded, then another to query the length. These are now consolidated into a
22
+ single `DocState::get_text_len` that takes one lock and one container-store
23
+ lookup. The lazy-snapshot memory behavior is preserved: a still-lazy
24
+ container reads its cached length metadata without materializing the full
25
+ richtext state. `bench_text B4 apply` (per-op text editing): ~389ms -> ~352ms.
26
+
27
+ ## 1.13.4
28
+
29
+ ### Patch Changes
30
+
31
+ - 4d577ad: Fix two O(n^2) editing slowdowns.
32
+
33
+ 1. Editing with UTF-16 / UTF-8 (byte) positions (the default in the JS binding)
34
+ validated each position by materializing the entire `[0, pos)` prefix string,
35
+ making every `insert`/`delete`/`splice`/`mark` O(n) and a run of edits O(n^2)
36
+ (regression since 1.12.0). The boundary check now reads the rope's prefix
37
+ caches via the cursor (O(log n)). Unicode-indexed editing was unaffected.
38
+ 2. When a subscriber is attached and many edits land on the same container within
39
+ one event batch (e.g. random-position inserts, or many distinct map-key
40
+ writes), building the event cloned the growing accumulated diff on every
41
+ compose — O(n^2) in the number of fragments. The diffs are now composed in
42
+ place. This affected text, map and list events.
43
+ 3. Converting a UTF-16 / UTF-8 position within a text chunk to a unicode offset
44
+ scanned the chunk char-by-char, so editing/slicing a large contiguous chunk
45
+ (a big insert, a loaded document, or a long run of typed text that merges into
46
+ one chunk) was O(chunk length) per op. Chunks that contain no astral-plane
47
+ characters (UTF-16) or are pure ASCII (UTF-8) now convert in O(1), covering
48
+ essentially all real-world text (ASCII/Latin/CJK).
49
+
3
50
  ## 1.13.3
4
51
 
5
52
  ### Patch Changes