demo: Add benchmark-react with normalization and ref-stability scenarios#3783
demo: Add benchmark-react with normalization and ref-stability scenarios#3783
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
af004f6 to
a2cb25d
Compare
|
Size Change: 0 B Total Size: 80.5 kB ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3783 +/- ##
=======================================
Coverage 98.05% 98.05%
=======================================
Files 151 151
Lines 2834 2834
Branches 555 555
=======================================
Hits 2779 2779
Misses 11 11
Partials 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d8d904f to
98de6fa
Compare
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: 802d8a7 | Previous: a8c10ca | Ratio |
|---|---|---|---|
normalizeLong |
447 ops/sec (±1.33%) |
448 ops/sec (±0.82%) |
1.00 |
normalizeLong Values |
412 ops/sec (±1.04%) |
404 ops/sec (±0.48%) |
0.98 |
denormalizeLong |
277 ops/sec (±3.48%) |
275 ops/sec (±2.97%) |
0.99 |
denormalizeLong Values |
264 ops/sec (±2.22%) |
264 ops/sec (±2.36%) |
1 |
denormalizeLong donotcache |
1055 ops/sec (±0.17%) |
1043 ops/sec (±0.15%) |
0.99 |
denormalizeLong Values donotcache |
784 ops/sec (±0.19%) |
759 ops/sec (±0.20%) |
0.97 |
denormalizeShort donotcache 500x |
1572 ops/sec (±0.14%) |
1431 ops/sec (±0.16%) |
0.91 |
denormalizeShort 500x |
817 ops/sec (±2.15%) |
785 ops/sec (±2.10%) |
0.96 |
denormalizeShort 500x withCache |
6388 ops/sec (±0.68%) |
4769 ops/sec (±0.62%) |
0.75 |
queryShort 500x withCache |
2593 ops/sec (±0.13%) |
2611 ops/sec (±0.31%) |
1.01 |
buildQueryKey All |
55460 ops/sec (±0.31%) |
58214 ops/sec (±0.33%) |
1.05 |
query All withCache |
6734 ops/sec (±0.29%) |
5813 ops/sec (±0.25%) |
0.86 |
denormalizeLong with mixin Entity |
278 ops/sec (±2.37%) |
277 ops/sec (±2.02%) |
1.00 |
denormalizeLong withCache |
7077 ops/sec (±0.21%) |
6431 ops/sec (±0.09%) |
0.91 |
denormalizeLong Values withCache |
5109 ops/sec (±0.14%) |
4658 ops/sec (±0.10%) |
0.91 |
denormalizeLong All withCache |
6462 ops/sec (±0.17%) |
5468 ops/sec (±0.09%) |
0.85 |
denormalizeLong Query-sorted withCache |
6755 ops/sec (±0.26%) |
6294 ops/sec (±0.09%) |
0.93 |
denormalizeLongAndShort withEntityCacheOnly |
1691 ops/sec (±0.33%) |
1551 ops/sec (±0.25%) |
0.92 |
getResponse |
4682 ops/sec (±0.47%) |
3770 ops/sec (±0.23%) |
0.81 |
getResponse (null) |
10747864 ops/sec (±0.99%) |
9815415 ops/sec (±0.77%) |
0.91 |
getResponse (clear cache) |
269 ops/sec (±2.05%) |
272 ops/sec (±2.12%) |
1.01 |
getSmallResponse |
3365 ops/sec (±0.13%) |
3231 ops/sec (±0.39%) |
0.96 |
getSmallInferredResponse |
2501 ops/sec (±0.31%) |
2476 ops/sec (±0.21%) |
0.99 |
getResponse Collection |
4513 ops/sec (±0.46%) |
3763 ops/sec (±0.15%) |
0.83 |
get Collection |
4512 ops/sec (±0.32%) |
3539 ops/sec (±0.31%) |
0.78 |
get Query-sorted |
5241 ops/sec (±0.20%) |
5072 ops/sec (±0.11%) |
0.97 |
setLong |
457 ops/sec (±0.18%) |
452 ops/sec (±0.54%) |
0.99 |
setLongWithMerge |
261 ops/sec (±0.12%) |
258 ops/sec (±0.29%) |
0.99 |
setLongWithSimpleMerge |
276 ops/sec (±0.16%) |
273 ops/sec (±0.18%) |
0.99 |
setSmallResponse 500x |
945 ops/sec (±0.11%) |
903 ops/sec (±0.17%) |
0.96 |
This comment was automatically generated by workflow using github-action-benchmark.
5ad1b81 to
4df9d01
Compare
c8bc040 to
081e48d
Compare
- Browser benchmark comparing @data-client/react (Playwright, customSmallerIsBetter). - Scenarios: mount, update entity/author, ref-stability (item/author ref counts). - Hot-path (CI) vs with-network (local): simulated delay for overfetch comparison. - CI workflow runs hot-path only; reports to rhysd/github-action-benchmark. Made-with: Cursor
081e48d to
06986ed
Compare
1f5d167 to
a496880
Compare
fix yarn lock
a496880 to
0253c11
Compare
| }); | ||
| } | ||
| return { items, authors }; | ||
| } |
There was a problem hiding this comment.
generateFreshData exported but never imported anywhere
Low Severity
generateFreshData is exported but has zero consumers — no file in the benchmark suite imports it. The comment mentions "bulk ingestion scenarios" but no such scenario exists in the codebase. This is dead code that adds maintenance burden without providing value.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


Motivation
We need a browser-based benchmark for
@data-client/reactthat highlights the performance advantages of normalization and referential equality: when one entity is updated, only components that use that entity get new references; others keep the same object reference so React can skip rerenders. This enables comparison against other React data libraries (e.g. TanStack Query, SWR) and surfaces regressions in CI.Solution
examples/benchmark-react: Playwright-driven benchmark that runs a small React app with shared authors, measures mount/update duration viaperformance.measure(), and reports incustomSmallerIsBetterformat forrhysd/github-action-benchmark.data-clienttrack our regressions; competitor libraries (TanStack Query, SWR, baseline) are benchmarked locally for comparison only.yarn bench:run:compilerbuilds withbabel-plugin-react-compiler(via@anansi/babel-preset'sreactCompileroption) and labels results[compiler]for side-by-side comparison in the report viewer.Scenarios
Hot path (CI, data-client only)
Queryschema memoization vsuseMemosort)Local comparison only
Key design decisions
performance.measure()(JS-driven), React ProfileractualDuration(reconciliation), Chrome trace duration (full rendering pipeline)bench/report-viewer.html): filterable table (base/react-commit/trace), time-series charting via history file loadingScripts
yarn bench:runyarn bench:run:compiler[compiler]yarn build:compileryarn bench:compiler[compiler]label onlyOpen questions
N/A
Made with Cursor
Note
Medium Risk
Adds a large new Playwright-driven benchmarking app plus a new CI workflow that will run on PRs/pushes; while it doesn’t affect runtime library code, it changes CI behavior and introduces many new scripts/deps that could be flaky or slow.
Overview
Introduces a new browser-based React benchmarking harness in
examples/benchmark-reactto measure end-to-end render performance (mount/update durations, ref-stability counts, derived/sorted views, optional memory/trace metrics) across@data-client/reactand local competitor baselines.Adds
benchmark-reactGitHub Actions workflow to build and run the Playwright benchmarks and report results viarhysd/github-action-benchmark, and updates existing CI workflows with concurrency/permissions tweaks (including the Node benchmark workflow cache key fix).Wires the new benchmark app into the monorepo (
examples/benchmark-reactworkspace +build:benchmark-reactscript) and updates benchmarking documentation/agent notes; also updates the website playground generated@data-client/resttype definitions.Written by Cursor Bugbot for commit 802d8a7. This will update automatically on new commits. Configure here.