Skip to content

perf: diagnose iOS snapshot latency jitter#920

Open
thymikee wants to merge 1 commit into
mainfrom
perf/ios-snapshot-latency-diagnostics-917
Open

perf: diagnose iOS snapshot latency jitter#920
thymikee wants to merge 1 commit into
mainfrom
perf/ios-snapshot-latency-diagnostics-917

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Add bounded iOS snapshot timing diagnostics from the XCTest runner into snapshotDiagnostics, including backend, phase, and selected-backend timing.

Keep default snapshot output compact by capping retained samples and phase keys while surfacing larger evidence through debug diagnostics/session artifacts.

Refs #917

Validation

pnpm exec vitest run src/__tests__/snapshot-diagnostics.test.ts src/commands/capture/index.test.ts passed.

pnpm check:quick, pnpm format, pnpm build, and pnpm build:xcuitest passed.

pnpm check:unit was run twice; each full run had one unrelated flaky src/utils/__tests__/daemon-client.test.ts failure, and each failing test passed when rerun in isolation.

Manual iOS simulator evidence on iPhone 17 Pro Max with Settings: 4 Settings-root snapshot -i --json --debug samples and 3 General-subpage samples succeeded, and the session was closed. The first root snapshot was 6486ms end-to-end while runner-reported snapshot work was 248ms; warm root snapshots settled around 121ms end-to-end with runner_total around 115ms, backend.tree around 86ms, and xctest_root_snapshot around 51ms. This points the observed cold jitter at runner/session lifecycle or daemon transport startup rather than accessibility traversal/shaping.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB +2.2 kB
JS gzip 445.6 kB 446.2 kB +621 B
npm tarball 586.2 kB 587.5 kB +1.4 kB
npm unpacked 2.0 MB 2.0 MB +5.8 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.6 ms 29.9 ms +1.3 ms
CLI --help 50.9 ms 52.1 ms +1.2 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/9722.js +278 B +80 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.

1 participant