svelte-realtime 0.1.6 → 0.1.7
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/README.md +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -647,7 +647,7 @@ const [board, column] = await batch(() => [
|
|
|
647
647
|
], { sequential: true });
|
|
648
648
|
```
|
|
649
649
|
|
|
650
|
-
Each call resolves or rejects independently -- one failure does not cancel the others. Batches are limited to 50 calls
|
|
650
|
+
Each call resolves or rejects independently -- one failure does not cancel the others. Batches are limited to 50 calls -- enforced both client-side (rejects before sending) and server-side.
|
|
651
651
|
|
|
652
652
|
---
|
|
653
653
|
|
|
@@ -1511,7 +1511,7 @@ The adapter's `sendQueued()` drops the oldest item if the queue exceeds 1000. Un
|
|
|
1511
1511
|
|
|
1512
1512
|
### Batch size (max 50 calls)
|
|
1513
1513
|
|
|
1514
|
-
A single `batch()` call is limited to 50 RPC calls.
|
|
1514
|
+
A single `batch()` call is limited to 50 RPC calls. The client rejects before sending if the limit is exceeded, and the server enforces the same limit as a safety net. Split into multiple `batch()` calls if you need more.
|
|
1515
1515
|
|
|
1516
1516
|
### ws.subscribe() vs the subscribe hook
|
|
1517
1517
|
|
|
@@ -1773,6 +1773,14 @@ What gets measured:
|
|
|
1773
1773
|
|
|
1774
1774
|
Merge strategies use an internal `Map<key, index>` for O(1) lookups instead of linear scans. Updates and upserts on keyed strategies (crud, presence, cursor) are constant-time regardless of array size. Deletes and prepends require an index rebuild (linear), which matches the cost of the delete itself.
|
|
1775
1775
|
|
|
1776
|
+
### Event batching (browser)
|
|
1777
|
+
|
|
1778
|
+
In the browser, incoming pub/sub events are queued and flushed once per `requestAnimationFrame` instead of triggering a Svelte store update per event. This is automatic -- no configuration needed.
|
|
1779
|
+
|
|
1780
|
+
With high-frequency streams (e.g. 1000 cursors at 20 updates/sec), this reduces reactive store updates from ~20,000/sec to ~60/sec (one per frame). All merge operations still run, but Svelte only diffs and re-renders once per frame.
|
|
1781
|
+
|
|
1782
|
+
In Node/SSR (tests, `__directCall`, etc.), events apply synchronously -- no batching overhead.
|
|
1783
|
+
|
|
1776
1784
|
These benchmarks run in-process with mock objects (no real network). They isolate the framework overhead from network latency. See [bench/rpc.js](bench/rpc.js) for the full source.
|
|
1777
1785
|
|
|
1778
1786
|
---
|