-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[NFC] Remove -debug-time-compilation #32938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This flag no longer does anything now that the unified statistics reporting infrastructure exists. It is better to use -driver-time-compilation to see a bird's eye view of timing statistics for frontend jobs, and -stats-output-dir to see a down-and-dirty view of everything including performance counters.
Teach the UnifiedStatsReporter to directly construct llvm::NamedRegionTimer for itself.
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor thoughts, but overall OK.
- `-Xfrontend -debug-time-compilation`: asks each frontend to print out timers | ||
for each phase of its execution. Its output (per-frontend) looks like this: | ||
|
||
``` | ||
===-------------------------------------------------------------------------=== | ||
Swift compilation | ||
===-------------------------------------------------------------------------=== | ||
Total Execution Time: 0.0876 seconds (0.0877 wall clock) | ||
|
||
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- | ||
0.0241 ( 53.9%) 0.0394 ( 92.0%) 0.0635 ( 72.5%) 0.0635 ( 72.5%) Import resolution | ||
0.0170 ( 38.0%) 0.0025 ( 5.8%) 0.0195 ( 22.3%) 0.0195 ( 22.2%) Type checking / Semantic analysis | ||
0.0013 ( 3.0%) 0.0004 ( 0.8%) 0.0017 ( 1.9%) 0.0017 ( 1.9%) LLVM output | ||
0.0010 ( 2.3%) 0.0003 ( 0.7%) 0.0013 ( 1.5%) 0.0013 ( 1.5%) SILGen | ||
0.0006 ( 1.4%) 0.0002 ( 0.4%) 0.0008 ( 0.9%) 0.0008 ( 0.9%) IRGen | ||
0.0004 ( 0.8%) 0.0000 ( 0.1%) 0.0004 ( 0.5%) 0.0004 ( 0.5%) SIL optimization | ||
0.0002 ( 0.5%) 0.0001 ( 0.1%) 0.0003 ( 0.3%) 0.0003 ( 0.3%) LLVM optimization | ||
0.0001 ( 0.1%) 0.0000 ( 0.1%) 0.0001 ( 0.1%) 0.0001 ( 0.1%) Parsing | ||
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) SIL verification (pre-optimization) | ||
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) SIL verification (post-optimization) | ||
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) AST verification | ||
0.0448 (100.0%) 0.0428 (100.0%) 0.0876 (100.0%) 0.0877 (100.0%) Total | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that what was nice about this was that it was an easy way to get per-frontend-per-phase info. How would you do that now? I'm sorry to see it go, but I think there are no RecursionSafeTimers in the compiler anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have to use the full -stats-dir
output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a loss, but not your fault, since the flag doesn't work anymore.
@@ -146,9 +145,8 @@ auxName(StringRef ModuleName, | |||
} | |||
|
|||
class UnifiedStatsReporter::RecursionSafeTimers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any of these left in the compiler? If not, were they replaced by something else? A quick search of the code seems to say there are none. Is NamedRegionTimer already recursion-safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// First make a note in the recursion-safe timers; these
// are active anytime UnifiedStatsReporter is active.
if (IsEntry) {
RecursiveTimers->beginTimer(T.EventName);
} else {
RecursiveTimers->endTimer(T.EventName);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to see usages because of the Optional::emplace
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I was looking for the individual uses in the code, like: checkTypes() { RecursiveTimer rt; .... }
⛵ |
This flag no longer does anything now that the unified statistics
reporting infrastructure exists. It is better to use
-driver-time-compilation to see a bird's eye view of timing statistics
for frontend jobs, and -stats-output-dir to see a down-and-dirty view of
everything including performance counters.
While I'm here, remove the SharedTimer infrastructure since it no longer has any real use in the compiler.