Skip to content

perf: avoid Android hierarchy probe for scroll#671

Merged
thymikee merged 1 commit into
mainfrom
perf/android-scroll-fast-path
Jun 2, 2026
Merged

perf: avoid Android hierarchy probe for scroll#671
thymikee merged 1 commit into
mainfrom
perf/android-scroll-fast-path

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Jun 2, 2026

Summary

Restore Android scroll to the cheap display-size path so normal scroll commands no longer capture and parse a UI hierarchy before every swipe.

This regressed in d087a62 (#612), where scroll started resolving viewport size through Android UI hierarchy capture. In the Android perf comparison, scroll down moved from ~734ms daemon median to ~3410ms daemon median.

Adds a regression assertion that Android scroll does not invoke uiautomator/dump for the explicit-pixels path.

Scope

Touched 2 files: Android input actions and the existing Android platform test.

Validation

Verified with git diff --check and pnpm typecheck.

Checked for dead code around the removed Android scroll hierarchy probe: getAndroidGestureViewportSize, largestAndroidUiNodeRect, and android_gesture_viewport_probe_failed are gone; captureAndroidUiHierarchyXml and androidUiNodes remain used by Android fill verification/tests.

Ran pnpm check:fallow --base origin/main. It only flagged the unrelated untracked scripts/prototypes/* files that are not part of this PR; no Android scroll dead code was reported.

Ran the React Navigation Android Maestro suite from /Users/thymikee/.codex/worktrees/dffd/react-navigation/example using the built local agent-device binary: 37 passed, 1 failed in 340.3s. The failure was Stack - Preload Flow after returning from details and was not scroll-related; tab-view/scroll-related flows passed.

Verified the built Android snapshot path uses the new helper backend with androidSnapshot.backend="android-helper" and helperTransport="persistent-session". A patched source-mode run fell back to uiautomator because source mode lacked the packaged helper artifact, so it was not used as final backend validation.

Local pnpm vitest/format/build in this worktree are blocked by macOS native binding code-signature failures in rolldown/oxfmt/rspack optional bindings.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Size Report

Metric Base Current Diff
JS raw 1.1 MB 1.1 MB -435 B
JS gzip 362.6 kB 362.5 kB -128 B
npm tarball 467.5 kB 467.4 kB -121 B
npm unpacked 1.6 MB 1.6 MB -435 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.3 ms 27.2 ms -1.1 ms
CLI --help 43.5 ms 42.8 ms -0.7 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/input-actions.js -435 B -128 B

@thymikee thymikee merged commit 3847f71 into main Jun 2, 2026
18 checks passed
@thymikee thymikee deleted the perf/android-scroll-fast-path branch June 2, 2026 13:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-02 13:42 UTC

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