Repository navigation
test(zero-swift): time the main thread and count layouts in TestHost's frame probe - #274
Merged
Merged
Conversation
…s frame probe The frame probe checked positions and blank space but not what a frame cost, which the last perf check listed as missing. From the first phase after `open`, its summary now also has: - `busyms`: the main thread's busy time (run loop wake to wait) per display frame - `stalls=N120/N60` and `stallms`: busy spans over 8.3 and 16.7 ms, and their total - `layouts` (with `-probe-layouts 1`): layouts of SwiftUI's hosting views per frame the list moved, by hooking their `layout`/`layoutSubviews` The new fields come before `last=[…]`, so the UI tests' parsing of `wrong=`, `phases=`, `flings=` and the ` done` suffix is unchanged. Counting layouts costs about 1.5 ms per frame on macOS in `blanking`, so `busyms` compares only between runs with the same flags. Amp-Thread-ID: https://ampcode.com/threads/T-884aab88-be49-4bc7-96a1-044f0e71dabf Co-authored-by: tmm <tmm@tmm.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TestHost frame probe checks rows' positions and blank space but not what a frame costs, which the last perf check listed as missing ("layouts per frame and frame time in TestHost"). From the first phase after
open, the probe's summary now also reports:busyms: the main thread's busy time per display frame, measured with a run loop observer from wake to the next waitstalls=N120/N60andstallms: how many busy spans ran over 8.3 ms and over 16.7 ms, and the total time of the spans over 8.3 mslayouts, with-probe-layouts 1: layouts of SwiftUI's hosting views (the rows' and the list's) per frame the list moved, counted by hooking theirlayout/layoutSubviewsExample, macOS, issue list with SwiftUI rows,
-probe-script blanking -latency 50:The new fields come before
last=[…], soFrameProbeUITests' parsing ofwrong=,phases=[…],flings=[…]and thedonesuffix doesn't change. Counting layouts costs time itself: about 1.5 ms per frame on macOS inblanking(4.27 vs 2.69 ms busy). Sobusymsshould only be compared between runs with the same flags, as the doc comment now says.These are the numbers behind #273, which cut macOS busy time per frame by 15–30%.
Run locally. Built and run in Release for macOS and the iOS Simulator (Xcode 27.3) with the
issues,blankingandchatscripts.swift format lint --strict.No changeset: TestHost only.