Skip to content

test(test-app): add a perf lab with seeded React render problems - #3612

Merged
thymikee merged 2 commits into
mainfrom
feat/test-app-perf-lab
Oct 14, 2026
Merged

thymikee merged 2 commits into
mainfrom
feat/test-app-perf-lab

Conversation

@thymikee

@thymikee thymikee commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a Perf lab screen to the test-app: seven seeded JavaScript render problems for the built-in React profiler in #3613 / #3618. Each scenario renders one culprit and a Run button that replays the slow interaction as a fixed burst, then sets perf-status to done. Open one with agent-device-test-app://perf-lab?scenario=<id>.

Scenario Seeded problem
expensive-render the component recomputes on every render
memo-defeated memoized rows get a new callback and style each render
context-cascade a fast-changing counter shares one context with a stable field
parent-cascade typing re-renders unmemoized rows
render-storm a 16 ms state timer
effect-chain derived state is copied in an effect
eager-list 1,200 tiles mount in one commit, on every Run

PerfLabScreen.tsx imports only React and React Native, so it can be copied into bare apps to check other RN versions. The README lists the finding each scenario should produce. Touches 4 files under examples/test-app (380 lines).

Validation

At c51097fd1d, pnpm check:affected --run passes and the test-app tsc --noEmit passes.

Live runs on RN 0.88-rc Android used deep links of the agent-device-test-app://perf-lab?scenario=<id> form, opened both with agent-device open and adb am start. The same file, copied into bare RN 0.74, 0.76, 0.80 and 0.83 apps, produced each scenario's expected first finding on Android and on the RN 0.83 iOS simulator (results in #3613).

@thymikee
thymikee added this pull request to stack #3614 October 14, 2026 14:44
@thymikee thymikee changed the title feat/test app perf lab test(test-app): add a perf lab with seeded React render problems Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.22 MB 5.22 MB -405 B
Package (unpacked) 5.22 MB 5.22 MB -405 B
Package (download) 1.57 MB 1.57 MB -125 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.9 ms 25.2 ms +0.3 ms
CLI --help 69.7 ms 70.4 ms +0.7 ms

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/test-app/README.md
@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at e98bb92. I found no blocking problems in the diff.

Not blocking, and you can take or leave these: in EagerListScenario the step is setShown((value) => !value), so the first Run mounts the 1,200 tiles and any later Run in the same scenario unmounts them and the profile loses the eager-mount. Starting each Run from an unmounted state (or keying the scenario on runId) would fix that. The context-cascade README row and code comment say the provider builds a new value on every update, but the value is { user, unread } and legitimately changes with unread, so a useMemo would not help AvatarBadge. The real seeded problem is a fast-changing field sharing a context with a stable one, and the wording could say that. The README link form uses agent-device-test-app://perf-lab, while the sibling form at README:90 uses three slashes, so either match it or say which form the live run used.

The cubic-dev-ai P2 thread on the double-slash deep link does not apply: expo-router should treat a bare scheme:// prefix like scheme:///, and the PR says the Android deep links were run live. The author can resolve it unless that run used a different form: #3612 (comment)

The failed Smoke Tests job looks unrelated. It died in the Install Android SDK step, where sdkmanager reported "Error on ZipFile unknown archive" for the android-36 system image and the emulator never started. The diff only touches examples/test-app JS and the README, and no daemon or Android runtime code. A second Smoke Tests run is still in progress, so the Android job needs a re-run before merge.

I did not run a device or re-run pnpm check:affected and tsc. The live profiler results on RN 0.74 to 0.88-rc are claimed in #3613 and are not in this diff, and the profiler findings named in the README table depend on that code. The expo-router reading above comes from the sources and was not executed.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 14, 2026
@thymikee
thymikee force-pushed the feat/test-app-perf-lab branch from e98bb92 to c51097f Compare October 14, 2026 16:16
@thymikee

Copy link
Copy Markdown
Member Author

At c51097fd1d:

  • Eager list: each Run now mounts the tiles from an unmounted state. The mount is keyed on the Run id, not a toggle. A second Run on the iOS simulator still reported eager-mount ProductTile (1,200 instances, 438 ms).
  • Context cascade: the README row and the code comment now name the real seed: a fast-changing unread counter that shares one context with the stable user name the badges read.
  • Deep link: I kept the two-slash form, since the live runs used it, and replied in the thread.
  • Smoke Tests: the earlier failure was the sdkmanager zip error. The new push starts fresh runs.

@thymikee

Copy link
Copy Markdown
Member Author

The perf lab change at c51097f looks good. The logical delta since the earlier review at e98bb92 touches two files, and I found no problems in it. The deep-link form in the README is unchanged, and the author says live Android runs opened agent-device-test-app://perf-lab?scenario=<id> through both agent-device open and adb am start. I could not re-run that.

The one open inline thread on the deep-link form does not apply any more, so please resolve it: #3612 (comment). The README uses a different route shape for agent-device-test-app:///automation, so the two forms do not conflict.

I ran nothing locally. I checked the render and mount behavior, the deep-link resolution and the profiler findings from the code and from the author's live-run claims only. The expected finding names in the README, such as memo-defeated ContactRow, depend on profiler behavior in #3613 and #3618, which this PR does not contain.

CI is still pending. 14 of 18 jobs are queued and none has failed. This PR touches only examples/test-app, so it overlaps the lint, format and typecheck jobs and the smoke jobs that build the test-app. The earlier smoke failure was an sdkmanager zip error, which is outside this diff. Please wait for the queued jobs to finish before merging.

@thymikee
thymikee merged commit 64101c7 into main Oct 14, 2026
19 checks passed
@thymikee
thymikee deleted the feat/test-app-perf-lab branch October 14, 2026 17:01
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-14 17:09 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant