Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions website/blog/2026-10-03-v0.19-batch-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ no updater function. To batch mixed Entity types, deletes, or rows keyed by id,
[Controller.set()](/docs/api/Controller#set-array) for examples.
[#4103](https://github.com/reactive/data-client/pull/4103)

Try both buttons below. Each writes 500 new prices; the timer shows how long until the update is committed.
Try both buttons below. This browser check starts from an empty store and times `Promise.all` of 500 `set()`
calls against one batch `set()`. Both paths are one React commit, and each writes 500 new prices.

<HooksPlayground row>

Expand Down Expand Up @@ -143,8 +144,13 @@ render(<PriceStream />);

Each `set()` is a separate store update, and every store update copies that entity type's table. Writing rows one
at a time repeats that copy for every row, so the cost grows with both the batch size and the store size. A batch
pays it once, and notifies subscribers once instead of once per row: **20x** faster for 50 rows (10.8 ms to 0.54 ms)
and **95x** faster for 500 rows (103 ms to 1.08 ms), into a store holding 500 entities.
pays that copy once.

The chart is the node `setMany` benchmark in
[examples/benchmark/core.js](https://github.com/reactive/data-client/blob/master/examples/benchmark/core.js):
a store that already holds 500 entities, then a synchronous `set()` per row against one `set([Ticker], rows)`.
It measures the store update: **20x** faster for 50 rows (10.8 ms to 0.54 ms) and **95x** faster for 500 rows
(103 ms to 1.08 ms).
[#4103](https://github.com/reactive/data-client/pull/4103)

<center>
Expand All @@ -153,15 +159,15 @@ and **95x** faster for 500 rows (103 ms to 1.08 ms), into a store holding 500 en

```mermaid
xychart-beta
title "Batch set() speedup vs one set() per row"
title "Node setMany speedup into a 500-entity store"
x-axis ["50 rows", "500 rows"]
y-axis "Times faster" 0 --> 100
bar [20, 95]
```

</div>

[Benchmarks over time](https://reactive.github.io/data-client/dev/bench/) | [View benchmark](https://github.com/reactive/data-client/tree/master/examples/benchmark)
[Benchmarks over time](https://reactive.github.io/data-client/dev/bench/) | [View setMany benchmark](https://github.com/reactive/data-client/blob/master/examples/benchmark/core.js)

</center>

Expand Down
Loading