You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* demo(benchmark-react): add multi-view entity update scenario
Add `update-entity-multi-view` benchmark where the same issue entity
is displayed across three structurally different component trees (list
row, detail panel, pinned card strip). A single entity update must
propagate to all three views, exercising normalized cache cross-query
propagation vs. multi-query invalidation + refetch.
Made-with: Cursor
* demo(benchmark-react): fix post-mount GC inflating data-client times
Remove forced HeapProfiler.collectGarbage after pre-mount. The full GC
promoted all recently-allocated entities into V8's old generation,
causing write-barrier overhead during the timed action that
disproportionately penalized data-client's CPU-bound optimistic updates
(~1.8x inflation) while leaving network-bound libraries unaffected.
Also re-measure all scenarios and reorganize the README summary table
into Navigation / Mutations / Scaling categories.
Made-with: Cursor
* demo(benchmark-react): fix initMultiView double-setComplete race
measureMount's MutationObserver called setComplete() (setting
data-bench-complete) as soon as list items appeared, before the
detail panel and pinned card views were ready. The runner could
see this premature signal, proceed to the timed update phase, and
then receive a stale second setComplete() — corrupting the
measurement.
Refactor measureMount to return a Promise and accept
{ signalComplete: false } so initMultiView can suppress the
early completion signal and call setComplete() once after all
three views are ready.
Made-with: Cursor
Copy file name to clipboardExpand all lines: examples/benchmark-react/README.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ The repo has two benchmark suites:
31
31
-**Get list sorted** (`getlist-500-sorted`) — Mount 500 issues through a sorted/derived view. data-client uses `useQuery(sortedIssuesQuery)` with `Query` schema memoization; competitors use `useMemo` + sort.
32
32
-**Update entity** (`update-entity`) — Time to update one issue and propagate to the UI (unit: ms).
33
33
-**Update entity sorted** (`update-entity-sorted`) — After mounting a sorted view, update one entity. data-client's `Query` memoization avoids re-sorting when sort keys are unchanged.
34
+
-**Update entity multi-view** (`update-entity-multi-view`) — Update one issue that appears simultaneously in a list, a detail panel, and a pinned-cards strip. Exercises cross-query entity propagation: normalized cache updates once and all three views reflect the change; non-normalized libraries must invalidate and refetch each query independently.
34
35
-**Update user (scaling)** (`update-user`, `update-user-10000`) — Update one shared user with 1,000 or 10,000 mounted issues to test subscriber scaling. Normalized cache: one store update, all views of that user update.
35
36
-**Ref-stability** (`ref-stability-issue-changed`, `ref-stability-user-changed`) — Count of components that received a **new** object reference after an update (unit: count; smaller is better). Normalization keeps referential equality for unchanged entities.
36
37
-**Invalidate and resolve** (`invalidate-and-resolve`) — data-client only; invalidates a cached endpoint and immediately re-resolves. Measures Suspense boundary round-trip.
@@ -54,12 +55,10 @@ Illustrative **relative** results with **SWR = 100%** (baseline). For **duration
Copy file name to clipboardExpand all lines: examples/benchmark-react/src/shared/types.ts
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,10 @@ export interface BenchAPI {
45
45
moveItem?(id: number): void;
46
46
/** Switch between sorted list view and individual issue detail views 10 times (20 renders). Exercises normalized cache lookup (data-client) vs per-navigation fetch (others). */
47
47
listDetailSwitch?(count: number): void;
48
+
/** Mount list + detail panel + pinned card strip for multi-view entity propagation. */
49
+
initMultiView?(count: number): void;
50
+
/** Update an entity that appears in list + detail + pinned views; waits for all three to reflect the change. */
51
+
updateEntityMultiView?(id: number): void;
48
52
/** Trigger store garbage collection (data-client only). Used by memory scenarios to flush unreferenced data before heap measurement. */
49
53
triggerGC?(): void;
50
54
/** Cap DOM rendering to the first N items while keeping all data in the store. */
0 commit comments