bench-react: align data-client renderLimit with windowed denormalize#3900
bench-react: align data-client renderLimit with windowed denormalize#3900
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Summary
The
renderLimitharness was only capping DOM rows whileuseDLE(IssueResource.getList)still denormalized the full collection (e.g. 10k issues) on everyupdateUser, which inflates work and timing spread.Change
benchWindowedIssueListEndpoint: aQuerywhosequeryKeyslices the collection’s normalized ids torenderLimitbefore denormalization, so hooks only build objects for visible rows.key()to striprenderLimitfrom params so the endpoint cache key stays identical toIssueResource.getList(invalidation and shared cache behavior unchanged).ListView/StateListViewin the data-client app only whenlimitis set.Results (local)
npx tsx bench/runner.ts --lib data-client --scenario update-user-10000 --network-sim false:data-client.jsminified 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.