Compare before/after .trace bundles for a perf regression target
compareTracesByPatternCompare before and after .trace files to evaluate performance changes for hangs, hitches, or app launch. Outputs verdict (PASS/PARTIAL/FAIL) with before/after stats and deltas.
Instructions
[mg.trace][mg.ci] Trace-side counterpart to verifyFix. Compares two .trace bundles for a specific perf category (hangs, animation-hitches, or app-launch) and emits a PASS/PARTIAL/FAIL verdict plus before/after stats and deltas. Apply thresholds: hangs PASS when longest is below hangsMaxLongestMs (default 0); hitches PASS when longest is below hitchesMaxLongestMs (default 100ms — Apple's user-perceptible threshold); app-launch PASS when total is below appLaunchMaxTotalMs (default 1000ms).
Pipeline: capture before/after .trace (via recordTimeProfile or Xcode), then point this at the pair. The natural followup to a hangs/jank/launch fix PR.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| before | Yes | Absolute path to the baseline `.trace` (pre-fix). | |
| after | Yes | Absolute path to the post-fix `.trace`. | |
| category | Yes | Which perf category to verify. `hangs` parses the `potential-hangs` schema, `animation-hitches` parses `animation-hitches`, `app-launch` parses the launch breakdown. | |
| thresholds | No | ||
| hangsMinDurationMs | No | For `category: hangs` — only count hangs longer than this. Default 250ms (Apple's user-perceptible threshold for hangs). | |
| hitchesMinDurationMs | No | For `category: animation-hitches` — only count hitches longer than this. Default 100ms (Apple's user-perceptible threshold). |