Repository navigation
fix: report Swift function and type check times from Xcode 26 logs - #259
Open
alielsokary wants to merge 4 commits into
Open
alielsokary wants to merge 4 commits into
alielsokary wants to merge 4 commits into
Conversation
Xcode renamed the Swift compilation tasks: `CompileSwift` became `SwiftCompile` and `CompileSwiftSources` became `SwiftDriver`. `getDetailType` still matches only the old spellings, so on a current log every Swift step is reported as `.other`, and reporters that group by step type lose the compilation entirely. The guard in `getSwiftIndividualSteps` is keyed to the same old name. Fixing the classification alone would make it worse: a batch compilation names its files in the command and the log already carries a subSection per file, so with the step recognized as `.swiftCompilation` and the guard missing the modern name, every file gets reported twice. Both places are updated together. Measured on an Xcode 26.5 log of a ~400 module iOS app (5.9 min build), same log before and after, release build from source: other 314.4 min -> 9.0 min swiftCompilation 0 min -> 282.8 min swiftAggregatedCompilation 0 min -> 22.6 min detail steps 24869 -> 24869 The step count and the sum of durations stay identical, so nothing is duplicated or dropped; only the type of the existing steps changes. `SwiftEmitModule`, `EmitSwiftModule` and `CodeSign` account for the 9 minutes that remain unclassified. They have no matching case in `DetailStepType`, so they are left for a separate change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Alex Agapov <agapov.one@gmail.com>
A single Xcode 26.5 log carries both: 86884 steps signed `CompileSwift` from targets that compile whole module, next to 666 `SwiftCompile` and 457 `SwiftDriver` steps from the integrated driver. Calling the old spelling a leftover of older Xcode versions was wrong, and the comments said so. Behaviour is unchanged; this only rewrites comments and two test names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Alex Agapov <agapov.one@gmail.com>
Xcode 26 and later put the swift-frontend flags on the SwiftDriver section. The SwiftCompile section carries the -debug-time-function-bodies and -debug-time-expression-type-checking output but not the flag, so the parser skipped it and the reports never had function or type check times. Signed-off-by: Ali Elsokary <ali.elsokary.w@gmail.com>
…TML report From Xcode 14 on a SwiftCompile step compiles a batch of files and the function and type check times are parsed onto its per file substeps. The reporter only read the times of the step itself, so the Swift functions and type checks sections of the index page stayed empty. Signed-off-by: Ali Elsokary <ali.elsokary.w@gmail.com>
alielsokary
requested review from
aleksandergrzyb,
ecamacho and
polac24
as code owners
September 21, 2026 15:59
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.
Depends on #256. The first two commits are #256, the last two are new.
With
-Xfrontend -debug-time-function-bodiesand-Xfrontend -debug-time-expression-type-checkingset, logs from Xcode 26 and later still produced no function or type check times in any report. Two causes:The flag is not on the section that holds the output
Xcode 26 and later put the swift-frontend flags on the
SwiftDriversection. TheSwiftCompilesection carries the timing output but not the flag, andSwiftCompilerParseronly looked at sections whose command names the flag. It now also accepts output that looks like timings.The HTML report only read times from the step itself
From Xcode 14 on a
SwiftCompilestep is a batch and the times are parsed onto its per file substeps.HtmlReporternow reads those too, so the Swift functions and Swift type checks sections of the index page fill in.Measured on a ResidentApp Debug build log, Xcode 27.0, on top of #256: