Skip to content

perf: speed up iOS simulator screenshots#918

Merged
thymikee merged 3 commits into
mainfrom
perf/ios-sim-screenshot-fast-path-916
Jun 29, 2026
Merged

perf: speed up iOS simulator screenshots#918
thymikee merged 3 commits into
mainfrom
perf/ios-sim-screenshot-fast-path-916

Conversation

@thymikee

@thymikee thymikee commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

Skip the redundant ensureBootedSimulator probe for session-backed iOS simulator screenshots. The simulator screenshot path already uses xcrun simctl io <udid> screenshot <path> and keeps physical devices/macOS on their existing paths; this change avoids an extra simctl list devices -j call once the daemon has an active simulator session.

Closes #916

Touched files: 8. Scope stayed within screenshot command/runtime handoff, iOS simulator screenshot path selection, and focused tests.

Validation

Static and focused checks passed:

  • node ./node_modules/oxfmt/bin/oxfmt --write ...
  • ./node_modules/.bin/vitest run --project unit src/platforms/ios/__tests__/index.test.ts src/daemon/__tests__/request-router-screenshot.test.ts - 101 tests passed
  • ./node_modules/.bin/tsc -p tsconfig.json
  • ./node_modules/.bin/oxlint . --deny-warnings
  • ./node_modules/.bin/rslib build
  • node --test test/integration/smoke-*.test.ts - 8 passed, 1 skipped
  • ./node_modules/.bin/vitest run --project unit --testTimeout=15000 - 285/286 files passed; one unrelated daemon-client cleanup assertion failed in the aggregate run, then ./node_modules/.bin/vitest run --project unit src/utils/__tests__/daemon-client.test.ts --testTimeout=15000 passed 28/28 on rerun. The unrelated Android file that failed with default timeout also passed on rerun with --testTimeout=15000.

Simulator evidence on iPhone 17 simulator D74E0B66-57EB-4EC1-92DC-DA0A30581FE7, iOS 26.2, Settings app session:

  • Bare candidate xcrun simctl io <udid> screenshot <path>: 1418, 1102, 1594, 2633, 2582 ms; median 1594 ms.
  • Public agent-device screenshot before this change, after open settings: 5164, 4939, 5439, 5152, 5194 ms; median 5164 ms.
  • Public agent-device screenshot after this change, after rebuild/daemon cleanup/open: 5636, 4739, 4699, 4838, 4905 ms; median 4838 ms.

The remaining gap is mostly simulator status-bar normalization/restoration, measured separately as roughly 700-970 ms per status_bar command. This PR keeps that behavior to preserve deterministic screenshots and host simulator state restoration.

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB +616 B
JS gzip 445.6 kB 445.8 kB +170 B
npm tarball 586.2 kB 586.3 kB +143 B
npm unpacked 2.0 MB 2.0 MB +616 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.1 ms 25.4 ms +0.2 ms
CLI --help 43.3 ms 42.8 ms -0.5 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/apps.js +367 B +84 B
dist/src/9722.js +167 B +60 B

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jun 28, 2026
@thymikee thymikee merged commit 59e1f4b into main Jun 29, 2026
20 checks passed
@thymikee thymikee deleted the perf/ios-sim-screenshot-fast-path-916 branch June 29, 2026 12:35
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-29 12:35 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.

perf: investigate faster iOS simulator screenshots

1 participant