# Performance

In addition to the data integirty benefits, [normalized caching](https://dataclient.io/docs/concepts/normalization.md) with entity-level memoization enables
significant performance gains for rich interactive applications.

## React rendering benchmarks

Full rendering pipeline (fetch through DOM commit) measured in a real browser via Playwright.[^setup]
React baseline uses useEffect + useState from the React docs.[^config]

[View benchmark source](https://github.com/reactive/data-client/tree/master/examples/benchmark-react) · [Methodology and results](https://github.com/reactive/data-client/blob/master/examples/benchmark-react/METHODOLOGY.md) · [Performance over time](https://reactive.github.io/data-client/react-bench/)

- **Cached Navigation**: Navigating between a full list and items in the list ten times.[^nav]
- **Mutation Propagation**: One store write updates every view that references the entity.[^mutation]
- **Scaling**: Renaming one user with 10k items stored and 100 rendered.[^scaling]

These benchmarks measure the framework's impact within the larger system. That
makes them most useful as comparisons between approaches, rather than as
absolute measurements of an application's overall performance. We use them to
guide library optimizations and catch performance regressions over time.

[^setup]: Measured 2026-11-05 on a Ryzen 9 7950X (64 GB, Ubuntu on WSL2, Node 26.12.1, headless Chromium from Playwright 1.64.0), each request delayed 40 ms plus 1 ms per 20 records. Medians of 10 to 60 samples per scenario after warmup, taken as the median of two full runs. [Full methodology](https://github.com/reactive/data-client/blob/master/examples/benchmark-react/METHODOLOGY.md).

[^config]: TanStack Query 5.96.2 (`staleTime` and `gcTime` set to `Infinity`), SWR 2.5.1 (revalidation on focus, reconnect and stale disabled), React 19.3.1. After a mutation, TanStack Query and SWR wait for the response and then invalidate and refetch; Data Client updates the store optimistically. [Configuration details](https://github.com/reactive/data-client/blob/master/examples/benchmark-react/METHODOLOGY.md#how-each-library-is-configured).

[^nav]: `list-detail-switch-10`: 21.2 ms for Data Client, 446 ms TanStack Query, 452 ms SWR, 1,351 ms baseline. That is 63.8× the baseline, 21.1× TanStack Query and 21.4× SWR.

[^mutation]: `update-entity`: 0.73 ms for Data Client, 136 ms TanStack Query, 137 ms SWR, 135 ms baseline. Other mutation scenarios range from 74× to 194× the baseline. [All results](https://github.com/reactive/data-client/blob/master/examples/benchmark-react/METHODOLOGY.md#results).

[^scaling]: `update-user-10000`: 5.7 ms for Data Client, 625 ms TanStack Query, 602 ms SWR, 606 ms baseline.

## Normalization benchmarks

Denormalization compared with the legacy [normalizr](https://github.com/paularmstrong/normalizr)
library. Entity-level memoization maintains global referential equality and
speeds up repeated access, including after [mutations](https://dataclient.io/docs/getting-started/mutations.md).

[View benchmark source](https://github.com/reactive/data-client/blob/master/examples/benchmark) · [Methodology](https://github.com/reactive/data-client/blob/master/examples/benchmark-react/METHODOLOGY.md#normalization-benchmarks)
