Skip to content

perf(platform-ios): adapt startup to host capabilities - #174

Merged
V3RON merged 6 commits into
mainfrom
agent/capability-aware-ios-startup
Jul 30, 2026
Merged

perf(platform-ios): adapt startup to host capabilities#174
V3RON merged 6 commits into
mainfrom
agent/capability-aware-ios-startup

Conversation

@V3RON

@V3RON V3RON commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What is this?

Harness now chooses how to prepare the iOS XCTest permission agent according to host memory and CPU capacity. Constrained machines build the agent before starting simulator preparation, while capable machines overlap the two operations. This replaces the unconditional overlap proposed in #171 and adds a reusable host-capabilities helper for future resource-aware behavior.

The PR also makes the Metro block list consume the canonical cache root produced by createHarnessCache instead of duplicating the cache directory layout.

How does it work?

getHostCapabilities() reports total memory and available CPU parallelism from Node. An internal, argument-free startup policy enables overlap only when the host has strictly more than 8 GiB of memory and more than 6 available CPUs. The selected sequential or parallel strategy is logged at debug level.

Sequential startup awaits the XCTest build before checking, booting, and preparing the simulator. Parallel startup begins the build immediately, prepares the simulator concurrently, then waits for both before starting the agent. Both parallel branches are settled before cleanup so build and simulator failures propagate without leaving the controller, simulator override, or Harness-started simulator behind.

Metro receives harnessCache.paths.root when constructing its block list and derives a cross-platform, exact-root exclusion from that value. Cache-path construction therefore remains owned by @react-native-harness/cache, and the cache boundary check stays strict without an allowlist.

Why is this useful?

Resource-constrained macOS runners avoid making xcodebuild and the simulator compete for limited RAM and CPU, preserving a build-first startup path when contention would likely make startup slower. More powerful hosts retain the cold-start speedup from overlapping independent work. Reusing the canonical cache root also prevents Metro and the cache package from drifting onto different directory layouts.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-harness Ready Ready Preview Jul 30, 2026 5:11pm

Request Review

@V3RON
V3RON marked this pull request as ready for review July 30, 2026 17:14
@V3RON
V3RON merged commit d4678c8 into main Jul 30, 2026
8 of 11 checks passed
@V3RON
V3RON deleted the agent/capability-aware-ios-startup branch July 30, 2026 17:17
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