Skip to content

perf: speed up device inventory and status - #1723

Merged
thymikee merged 1 commit into
mainfrom
perf/device-inventory-status-latency
Aug 11, 2026
Merged

perf: speed up device inventory and status#1723
thymikee merged 1 commit into
mainfrom
perf/device-inventory-status-latency

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

  • overlap Apple simulator and physical-device discovery for unscoped inventory, reducing the same-run Apple critical path from about 2.39s to 1.53s
  • classify advisory device claims from one batched process snapshot instead of two synchronous ps launches per live claim; 159-claim status improved from 2.66s to 0.14s
  • keep device results atomic for JSON, SDK, and MCP consumers; partial-result streaming was evaluated but would complicate agent merge semantics without reducing completion latency

The change touches 9 files and stays within the devices/device-status command family and their shared process-liveness seam. No docs or skills changed because command syntax, output shape, and workflow guidance are unchanged.

Validation

pnpm check:affected --run passed immediately before push: 296 test files / 2,655 tests, 95% changed-line coverage, plus format, lint, typecheck, layering, Fallow, build, interaction contracts, and provider integration.

Regression evidence: the Apple concurrency test failed before the production change because only simctl started while simulator discovery was blocked; it passes with physical discovery starting concurrently. Batched process observation is covered by a one-ps-call test and fail-closed missing-observation coverage.

Manual host timing used the real Apple device services and 159 advisory claims. Cold CoreDevice startup remains externally variable and produced one ~11s outlier; the fix removes serialized simulator latency from that path rather than caching potentially stale inventory.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.13 MB 2.13 MB +951 B
JS gzip 695.5 kB 695.7 kB +295 B
npm tarball 826.8 kB 827.0 kB +228 B
npm unpacked 2.88 MB 2.88 MB +951 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.2 ms 28.3 ms +1.1 ms
CLI --help 66.2 ms 69.2 ms +3.0 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/internal/daemon.js 0 B -1 B
dist/src/screenshot-result.js 0 B +1 B
dist/src/runner-disposal.js 0 B -1 B

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Aug 10, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed exact head 117fba48d9. No actionable findings. Unscoped Apple inventory now overlaps simulator and physical discovery while preserving simulator-only, simulator-set, and UDID behavior; the concurrency regression is non-vacuous. Device-status claim inspection batches selected owner PIDs into one process snapshot while retaining fail-closed handling for missing/failed observations and unchanged public output. The change is code-review clean. All completed checks are green; iOS Smoke is still running, so final merge remains gated on that authoritative lane.

@thymikee
thymikee merged commit 1b75e10 into main Aug 11, 2026
31 checks passed
@thymikee
thymikee deleted the perf/device-inventory-status-latency branch August 11, 2026 05:37
@github-actions

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