Skip to content

perf: reduce cold iOS runner startup latency - #1927

Merged
thymikee merged 1 commit into
mainfrom
perf/ios-startup-prototypes
Aug 20, 2026
Merged

perf: reduce cold iOS runner startup latency#1927
thymikee merged 1 commit into
mainfrom
perf/ios-startup-prototypes

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Reduce cold iOS simulator startup latency without changing snapshot backends.

  • reuse the existing bounded fresh-boot observation instead of immediately paying for a duplicate simctl list devices -j; stale booleans and memo failures still fall back to native discovery
  • wake one runner connection retry from the runner's authoritative NWListener-ready marker, while keeping the HTTP probe authoritative
  • extract xcodebuild process launch/output ownership from the oversized runner session module and make retry wakeups cancellation- and resource-safe

On the same existing iPhone 17 Pro simulator, cold open plus the first interactive snapshot improved from 5.45s to 3.83s. Retained runner preparation remained effectively instant (14ms internally), and a warm snapshot measured 185ms.

This does not make private AX the default. The current private-AX backend still runs inside XCTest, so it cannot remove XCTest startup.

Validation

  • pnpm check:affected --run — 342 files / 2,533 tests passed, plus format, lint, typecheck, layering, fallow, and build
  • live isolated cold/retained/adopted startup matrix on the existing iPhone 17 Pro simulator
  • verified no simulator was created or deleted and the isolated runner/daemon were stopped

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.34 MB 2.34 MB +1.5 kB
JS gzip 769.6 kB 770.2 kB +548 B
npm tarball 895.4 kB 895.9 kB +532 B
npm unpacked 3.12 MB 3.12 MB +1.5 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.2 ms 21.7 ms +1.5 ms
CLI --help 44.8 ms 49.8 ms +4.9 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/runner-client.js +627 B +238 B
dist/src/runtime4.js +144 B +46 B
dist/src/runner-disposal.js +64 B +25 B
dist/src/internal/daemon.js 0 B +2 B

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed 6a6efce66c8d8f7031fc771ac2dd69c6a5caace4: clean. The readiness memo preserves native fallback, and the NWListener marker only shortens one retry while the HTTP probe remains authoritative. The launch extraction also gives xcodebuild ownership a clearer seam. Remaining CI evidence: iOS Smoke is in progress.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Aug 20, 2026
@thymikee
thymikee merged commit 56f2671 into main Aug 20, 2026
28 of 30 checks passed
@thymikee
thymikee deleted the perf/ios-startup-prototypes branch August 20, 2026 19:47
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-20 19:47 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