Skip to content

demo: Add cache GC measurement harnesses (Node, browser, Android)#4034

Open
ntucker wants to merge 1 commit into
masterfrom
demo/gc-benchmark-harnesses
Open

demo: Add cache GC measurement harnesses (Node, browser, Android)#4034
ntucker wants to merge 1 commit into
masterfrom
demo/gc-benchmark-harnesses

Conversation

@ntucker

@ntucker ntucker commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add opt-in cache GC baselines for Node (examples/benchmark start:gc), Chromium (examples/benchmark-react bench:gc), and release Hermes Android (examples/benchmark-native)
  • Wire BuildManifest / provenance verification so measurements bind to verified build identity rather than live HEAD
  • Document scenario axes, timing boundaries, and validation gates in example READMEs and the GC plan

Test plan

  • yarn install succeeds with the new examples/benchmark-native workspace
  • Node: yarn workspace example-benchmark build && yarn workspace example-benchmark start:gc:verify then a short start:gc filter run
  • Browser: yarn workspace example-benchmark-react build && yarn workspace example-benchmark-react test:gc-metrics && yarn workspace example-benchmark-react test:gc-provenance
  • Browser: yarn workspace example-benchmark-react bench:gc --scenario unique-1000 --samples 1
  • Native: yarn workspace example-benchmark-native typecheck && yarn workspace example-benchmark-native test && yarn workspace example-benchmark-native lint
  • Confirm CircleCI setup still strips example workspaces (including the new index)

Made with Cursor

…droid

Establish opt-in, provenance-verified baselines for data-client cache GC
interaction cost before changing GCPolicy behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs-site Ignored Ignored Preview Jul 19, 2026 5:22pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 30bdad5

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 30bdad5. Configure here.

SIDECAR_BUILD_ID="$(node -e 'console.log(JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")).buildId)' "${SIDECAR}")"
SIDECAR_DIGEST="$(node -e 'console.log(JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")).sourceDigest)' "${SIDECAR}")"
SIDECAR_APK_SHA="$(node -e 'console.log(JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")).apkSha256)' "${SIDECAR}")"
SIDECAR_ID="$(node -e 'console.log(JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")).sidecarId)' "${SIDECAR}")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Node eval argv index wrong

High Severity

Inline node -e snippets treat process.argv[1] as the first path argument, but with -e Node puts -e at index 1 and script arguments at index 2 onward. Sidecar verification, digest reads, and report provenance steps read or require the wrong paths, so host collection fails or skips checks.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30bdad5. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 81.2 kB

ℹ️ View Unchanged
Filename Size
examples/test-bundlesize/dist/App.js 1.46 kB
examples/test-bundlesize/dist/polyfill.js 307 B
examples/test-bundlesize/dist/rdcClient.js 10.9 kB
examples/test-bundlesize/dist/rdcEndpoint.js 8.07 kB
examples/test-bundlesize/dist/react.js 59.7 kB
examples/test-bundlesize/dist/webpack-runtime.js 784 B

compressed-size-action

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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: 30bdad5 Previous: 93555f8 Ratio
data-client: getlist-100 217.39 ops/s (± 3.9%) 121.95 ops/s (± 5.4%) 0.56
data-client: getlist-500 67.57 ops/s (± 4.2%) 40.65 ops/s (± 4.4%) 0.60
data-client: update-entity 625 ops/s (± 6.7%) 285.71 ops/s (± 8.1%) 0.46
data-client: update-user 588.24 ops/s (± 9.2%) 307.77 ops/s (± 7.5%) 0.52
data-client: getlist-500-sorted 68.03 ops/s (± 9.0%) 42.02 ops/s (± 8.9%) 0.62
data-client: update-entity-sorted 500 ops/s (± 7.6%) 270.27 ops/s (± 6.8%) 0.54
data-client: update-entity-multi-view 500 ops/s (± 9.6%) 277.78 ops/s (± 8.2%) 0.56
data-client: list-detail-switch-10 18.34 ops/s (± 6.2%) 6.96 ops/s (± 6.8%) 0.38
data-client: update-user-10000 134.23 ops/s (± 12.3%) 63.9 ops/s (± 11.5%) 0.48
data-client: invalidate-and-resolve 56.82 ops/s (± 6.2%) 30.58 ops/s (± 5.9%) 0.54
data-client: unshift-item 357.14 ops/s (± 6.0%) 185.19 ops/s (± 4.0%) 0.52
data-client: delete-item 526.32 ops/s (± 6.1%) 227.27 ops/s (± 4.1%) 0.43
data-client: move-item 298.57 ops/s (± 7.7%) 141.85 ops/s (± 6.9%) 0.48

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Benchmark

Details
Benchmark suite Current: 30bdad5 Previous: 93555f8 Ratio
normalizeLong 444 ops/sec (±5.07%) 447 ops/sec (±4.75%) 1.01
normalizeLong Values 410 ops/sec (±1.34%) 408 ops/sec (±1.51%) 1.00
normalizeLong Scalar 376 ops/sec (±2.72%) 352 ops/sec (±3.69%) 0.94
normalizeLong Scalar update 899 ops/sec (±0.19%) 895 ops/sec (±0.68%) 1.00
denormalizeLong 235 ops/sec (±6.80%) 233 ops/sec (±6.00%) 0.99
denormalizeLong Values 224 ops/sec (±4.94%) 213 ops/sec (±4.94%) 0.95
denormalizeLong donotcache 1009 ops/sec (±1.05%) 1002 ops/sec (±0.64%) 0.99
denormalizeLong Values donotcache 734 ops/sec (±0.25%) 737 ops/sec (±0.59%) 1.00
denormalizeLong Scalar donotcache 1026 ops/sec (±0.15%) 1073 ops/sec (±0.13%) 1.05
denormalizeShort donotcache 500x 1413 ops/sec (±0.10%) 1437 ops/sec (±0.29%) 1.02
denormalizeShort 500x 656 ops/sec (±6.25%) 639 ops/sec (±6.97%) 0.97
denormalizeShort 500x withCache 6764 ops/sec (±0.12%) 6834 ops/sec (±5.52%) 1.01
queryShort 500x withCache 3242 ops/sec (±1.19%) 3206 ops/sec (±0.97%) 0.99
buildQueryKey All 58192 ops/sec (±0.51%) 58478 ops/sec (±1.39%) 1.00
query All withCache 6019 ops/sec (±2.43%) 5828 ops/sec (±2.46%) 0.97
denormalizeLong with mixin Entity 219 ops/sec (±6.35%) 209 ops/sec (±7.50%) 0.95
denormalizeLong withCache 6766 ops/sec (±0.31%) 7517 ops/sec (±0.32%) 1.11
denormalizeLong withCache (Scalar churn) 6760 ops/sec (±0.79%) 7491 ops/sec (±0.24%) 1.11
denormalizeLong Values withCache 5177 ops/sec (±1.51%) 5132 ops/sec (±1.60%) 0.99
denormalizeLong Scalar withCache 7603 ops/sec (±0.24%) 7648 ops/sec (±0.98%) 1.01
denormalizeLong Scalar update withCache 4012 ops/sec (±0.33%) 4074 ops/sec (±0.24%) 1.02
denormalizeLong All withCache 6083 ops/sec (±0.30%) 6058 ops/sec (±0.18%) 1.00
denormalizeLong Query-sorted withCache 6305 ops/sec (±1.47%) 6098 ops/sec (±1.48%) 0.97
denormalizeLongAndShort withEntityCacheOnly 1720 ops/sec (±0.31%) 1748 ops/sec (±0.19%) 1.02
denormalize bidirectional 50 4532 ops/sec (±11.43%) 4498 ops/sec (±10.41%) 0.99
denormalize bidirectional 50 donotcache 40831 ops/sec (±0.33%) 42385 ops/sec (±1.43%) 1.04
getResponse 4456 ops/sec (±3.58%) 4418 ops/sec (±4.05%) 0.99
getResponse (null) 9791287 ops/sec (±1.07%) 10236651 ops/sec (±0.70%) 1.05
getResponse (clear cache) 201 ops/sec (±7.77%) 203 ops/sec (±7.07%) 1.01
getSmallResponse 3652 ops/sec (±0.23%) 3543 ops/sec (±0.24%) 0.97
getSmallInferredResponse 2918 ops/sec (±0.22%) 2852 ops/sec (±1.79%) 0.98
getResponse Collection 4492 ops/sec (±2.60%) 4306 ops/sec (±4.05%) 0.96
get Collection 3144 ops/sec (±0.28%) 2707 ops/sec (±0.19%) 0.86
get Query-sorted 5020 ops/sec (±1.64%) 5052 ops/sec (±1.47%) 1.01
setLong 465 ops/sec (±0.20%) 467 ops/sec (±0.60%) 1.00
setLongWithMerge 252 ops/sec (±0.75%) 257 ops/sec (±0.45%) 1.02
setLongWithSimpleMerge 273 ops/sec (±0.25%) 272 ops/sec (±0.80%) 1.00
setSmallResponse 500x 927 ops/sec (±1.63%) 926 ops/sec (±1.48%) 1.00

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

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (4a2faa5) to head (30bdad5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4034   +/-   ##
=======================================
  Coverage   97.84%   97.84%           
=======================================
  Files         156      156           
  Lines        3057     3057           
  Branches      612      612           
=======================================
  Hits         2991     2991           
  Misses         18       18           
  Partials       48       48           

☔ View full report in Codecov by Harness.
📢 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.

@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Verification: node -e / process.argv indexing in collect-report.sh

Checked the reported bug that inline node -e snippets treat process.argv[1] as the first path argument incorrectly (claiming -e occupies argv[1] and script args start at argv[2]).

Result: the issue does not exist — current indexing is correct.

With node -e, -e and the eval string go in process.execArgv, not process.argv. Script arguments start at process.argv[1]:

// node -e '…' foo bar
argv:     ["…/node", "foo", "bar"]
execArgv: ["-e", "…"]

Confirmed on Node 14, 16, 18, and 22 (this package requires >= 22.11.0).

Replayed the exact snippets from examples/benchmark-native/scripts/collect-report.sh against mock sidecar/report files:

  • Sidecar identity verification (lines 82–90) — OK
  • Digest/field reads (lines 92–95) — OK
  • Report provenance attach (lines 187–209) — OK

Shifting to argv[2] as the first path would break these steps (path becomes undefined). No code change needed.

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.

1 participant