perf: speed up iOS simulator screenshots#918
Open
thymikee wants to merge 1 commit into
Open
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Skip the redundant
ensureBootedSimulatorprobe for session-backed iOS simulator screenshots. The simulator screenshot path already usesxcrun simctl io <udid> screenshot <path>and keeps physical devices/macOS on their existing paths; this change avoids an extrasimctl list devices -jcall 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 buildnode --test test/integration/smoke-*.test.ts- 8 passed, 1 skipped./node_modules/.bin/vitest run --project unit --testTimeout=15000- 285/286 files passed; one unrelateddaemon-clientcleanup assertion failed in the aggregate run, then./node_modules/.bin/vitest run --project unit src/utils/__tests__/daemon-client.test.ts --testTimeout=15000passed 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:xcrun simctl io <udid> screenshot <path>: 1418, 1102, 1594, 2633, 2582 ms; median 1594 ms.agent-device screenshotbefore this change, afteropen settings: 5164, 4939, 5439, 5152, 5194 ms; median 5164 ms.agent-device screenshotafter 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_barcommand. This PR keeps that behavior to preserve deterministic screenshots and host simulator state restoration.