Skip to content

perf: speed up iOS simulator screenshots#918

Open
thymikee wants to merge 1 commit into
mainfrom
perf/ios-sim-screenshot-fast-path-916
Open

perf: speed up iOS simulator screenshots#918
thymikee wants to merge 1 commit into
mainfrom
perf/ios-sim-screenshot-fast-path-916

Conversation

@thymikee

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

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB +289 B
JS gzip 445.6 kB 445.7 kB +121 B
npm tarball 586.2 kB 586.3 kB +111 B
npm unpacked 2.0 MB 2.0 MB +289 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.3 ms 26.2 ms -0.1 ms
CLI --help 47.5 ms 47.5 ms +0.0 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/9722.js +167 B +60 B
dist/src/apps.js +68 B +37 B

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jun 28, 2026
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