solid-objects 0.14.2 → 0.14.4

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.
@@ -18,7 +18,36 @@ fields, then walks its prototype chain to discover methods and getters.
18
18
 
19
19
  The constructor must establish every persisted field and must not depend on
20
20
  external state. Solid Objects invokes it at four points: class validation,
21
- default creation, state hydration, and snapshot projection.
21
+ default creation, state hydration, and snapshot projection. Because the
22
+ constructor must not depend on external state, the runtime computes the default
23
+ state once for each registered class and gives each caller a detached copy.
24
+
25
+ ## State size and throughput
26
+
27
+ Solid Objects commits the whole state image on each turn. The turn therefore
28
+ reads, encodes, and writes every persisted field, and its cost grows with the
29
+ size of the state rather than with the size of the change.
30
+
31
+ Measured on August 29, 2026 on an Apple M5, macOS 26.6, Node.js 24.18.0, and
32
+ SQLite 3.53.1 through `node:sqlite`. One actor, one `increment()` operation,
33
+ sequential turns, 300 measured operations per row, and the `0.14.4` source
34
+ tree.
35
+
36
+ | Persisted state | ms per operation | Operations per second |
37
+ | --------------: | ---------------: | --------------------: |
38
+ | 0 KB | 1.60 | 625 |
39
+ | 16 KB | 1.64 | 611 |
40
+ | 128 KB | 2.53 | 395 |
41
+ | 1 MB | 9.32 | 107 |
42
+
43
+ These are developer-laptop numbers. They show the shape of the curve, not a
44
+ capacity guarantee. See [Benchmarks](benchmarks.md#large-state) for the harness
45
+ and the earlier numbers.
46
+
47
+ Keep one actor's state small, and divide a large state across more identities.
48
+ `warnStateBytes` reports one `solid_objects.state.large` instrumentation event
49
+ when a committed image passes its threshold, which defaults to 128 KB.
50
+ `maxStateBytes` is the hard limit, and it fails the turn.
22
51
 
23
52
  ## Observable broadcast modes
24
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-objects",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "description": "Race-free realtime state per application identity, backed by your SQL database",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -112,6 +112,7 @@
112
112
  "test:watch": "vitest",
113
113
  "benchmark": "pnpm run build && node benchmarks/run.ts",
114
114
  "benchmark:idle": "pnpm run build && node benchmarks/idle.ts",
115
+ "benchmark:large-state": "pnpm run build && node benchmarks/large-state.ts",
115
116
  "pack:check": "pnpm pack --dry-run && node scripts/check-package.mjs",
116
117
  "prepack": "pnpm run build"
117
118
  },