Skip to content

Commit 4c4be69

Browse files
chore: version packages
1 parent 8874574 commit 4c4be69

7 files changed

Lines changed: 57 additions & 32 deletions

File tree

.changeset/bounded-container-value-cache.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.changeset/wasm-kind-cache.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/loro-wasm-map/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# loro-crdt-map
22

3+
## 1.15.2
4+
5+
### Patch Changes
6+
7+
- fcd039c: Fix wasm memory retention when reading a document container by container
8+
(loro-dev/loro#1092).
9+
10+
Every read through a container handle (`LoroMap.keys()`/`get()`,
11+
`LoroList.get()`, `LoroText.toJSON()`, ...) decoded the container's value into
12+
an in-memory cache that was pinned for the lifetime of the document — about
13+
4 KB per container, released only by `doc.free()`. Walking a large document
14+
this way (the pattern loro-mirror's initial state build uses) retained ~4 KB ×
15+
containers-ever-read and trapped wasm32 at the 4 GiB limit around one million
16+
containers.
17+
18+
The decoded-value cache is now bounded (2048 entries, second-chance FIFO).
19+
Evicted entries are pure caches over the KV store and are re-decoded on the
20+
next read, so this only changes memory behavior, not API semantics.
21+
`doc.free()` semantics are unchanged.
22+
23+
Measured on the issue's repro (570-turn document, 188k container handles,
24+
release build): the handle walk retains no per-container memory (external
25+
memory flat at ~84 MiB vs +641 MiB before) and runs ~10x faster
26+
(1.28 s vs 12.5 s) thanks to the smaller working set.
27+
28+
- 8874574: perf: cache `kind()` results on container wrappers. `kind()` returns a constant string per container class; it is now memoized after the first call, so repeated reads (e.g. tree traversal in loro-mirror) no longer cross into WASM or allocate a fresh JS string. This extends the existing `id` cache to `kind()`.
29+
330
## 1.15.1
431

532
### Patch Changes

crates/loro-wasm-map/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loro-crdt-map",
3-
"version": "1.15.1",
3+
"version": "1.15.2",
44
"description": "Source maps for the loro-crdt WebAssembly bundles.",
55
"repository": {
66
"type": "git",

crates/loro-wasm/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## 1.15.2
4+
5+
### Patch Changes
6+
7+
- fcd039c: Fix wasm memory retention when reading a document container by container
8+
(loro-dev/loro#1092).
9+
10+
Every read through a container handle (`LoroMap.keys()`/`get()`,
11+
`LoroList.get()`, `LoroText.toJSON()`, ...) decoded the container's value into
12+
an in-memory cache that was pinned for the lifetime of the document — about
13+
4 KB per container, released only by `doc.free()`. Walking a large document
14+
this way (the pattern loro-mirror's initial state build uses) retained ~4 KB ×
15+
containers-ever-read and trapped wasm32 at the 4 GiB limit around one million
16+
containers.
17+
18+
The decoded-value cache is now bounded (2048 entries, second-chance FIFO).
19+
Evicted entries are pure caches over the KV store and are re-decoded on the
20+
next read, so this only changes memory behavior, not API semantics.
21+
`doc.free()` semantics are unchanged.
22+
23+
Measured on the issue's repro (570-turn document, 188k container handles,
24+
release build): the handle walk retains no per-container memory (external
25+
memory flat at ~84 MiB vs +641 MiB before) and runs ~10x faster
26+
(1.28 s vs 12.5 s) thanks to the smaller working set.
27+
28+
- 8874574: perf: cache `kind()` results on container wrappers. `kind()` returns a constant string per container class; it is now memoized after the first call, so repeated reads (e.g. tree traversal in loro-mirror) no longer cross into WASM or allocate a fresh JS string. This extends the existing `id` cache to `kind()`.
29+
330
## 1.15.1
431

532
### Patch Changes

crates/loro-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "loro-wasm"
3-
version = "1.15.1"
3+
version = "1.15.2"
44
edition = "2021"
55
publish = false
66
repository = "https://github.com/loro-dev/loro/"

crates/loro-wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loro-crdt",
3-
"version": "1.15.1",
3+
"version": "1.15.2",
44
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
55
"keywords": [
66
"crdt",

0 commit comments

Comments
 (0)