Skip to content

bench-react: align data-client renderLimit with windowed denormalize#3900

Closed
ntucker wants to merge 1 commit intomasterfrom
cursor/bench-windowed-denorm-0ef5
Closed

bench-react: align data-client renderLimit with windowed denormalize#3900
ntucker wants to merge 1 commit intomasterfrom
cursor/bench-windowed-denorm-0ef5

Conversation

@ntucker
Copy link
Copy Markdown
Collaborator

@ntucker ntucker commented Apr 10, 2026

Summary

The renderLimit harness was only capping DOM rows while useDLE(IssueResource.getList) still denormalized the full collection (e.g. 10k issues) on every updateUser, which inflates work and timing spread.

Change

  • Add benchWindowedIssueListEndpoint: a Query whose queryKey slices the collection’s normalized ids to renderLimit before denormalization, so hooks only build objects for visible rows.
  • Override key() to strip renderLimit from params so the endpoint cache key stays identical to IssueResource.getList (invalidation and shared cache behavior unchanged).
  • Use this endpoint from ListView / StateListView in the data-client app only when limit is set.

Results (local)

npx tsx bench/runner.ts --lib data-client --scenario update-user-10000 --network-sim false:

  • Scenario converged after 11 measurements (previously often hit max 50).
  • data-client.js minified bundle: ~+0.4 KB vs prior build.

bench/validate.ts: all scenarios pass for data-client.

Notes

This is benchmark-example only; no published package API changes.

Open in Web Open in Cursor 

Use a Query that slices collection ids in queryKey before denormalizing so
10k-store/100-DOM scenarios only materialize visible rows. Cache key strips
renderLimit to match IssueResource.getList for invalidation. Improves
update-user-10000 convergence and lowers timing spread vs full collection
denormalize each update.

Co-authored-by: Nathaniel Tucker <me@ntucker.me>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs-site Ignored Ignored Apr 10, 2026 11:07pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 10, 2026

⚠️ No Changeset found

Latest commit: d68b83c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark React

Details
Benchmark suite Current: d68b83c Previous: e66cc98 Ratio
data-client: getlist-100 135.14 ops/s (± 5.5%) 136.06 ops/s (± 7.2%) 1.01
data-client: getlist-500 38.46 ops/s (± 6.3%) 40.73 ops/s (± 6.2%) 1.06
data-client: update-entity 322.58 ops/s (± 9.1%) 294.12 ops/s (± 7.4%) 0.91
data-client: update-user 339.08 ops/s (± 7.7%) 333.33 ops/s (± 8.3%) 0.98
data-client: getlist-500-sorted 43.29 ops/s (± 4.5%) 41.76 ops/s (± 7.1%) 0.96
data-client: update-entity-sorted 303.03 ops/s (± 5.9%) 294.12 ops/s (± 5.7%) 0.97
data-client: update-entity-multi-view 317.54 ops/s (± 7.2%) 322.58 ops/s (± 7.1%) 1.02
data-client: list-detail-switch-10 7.37 ops/s (± 7.7%) 6.46 ops/s (± 5.6%) 0.88
data-client: update-user-10000 73.53 ops/s (± 12.4%) 78.12 ops/s (± 1.5%) 1.06
data-client: invalidate-and-resolve 33.5 ops/s (± 4.1%) 33.9 ops/s (± 5.5%) 1.01
data-client: delete-item 277.78 ops/s (± 5.0%) 270.27 ops/s (± 5.2%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.11%. Comparing base (e66cc98) to head (d68b83c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3900   +/-   ##
=======================================
  Coverage   98.11%   98.11%           
=======================================
  Files         153      153           
  Lines        2916     2916           
  Branches      566      566           
=======================================
  Hits         2861     2861           
  Misses         11       11           
  Partials       44       44           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker ntucker closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants