18
18
// FRONTEND_STATISTIC(Subsystem, Id)
19
19
// - Subsystem is a token to be stringified as a name prefix
20
20
// - Id is an identifier suitable for use in C++
21
+ //
22
+ // FRONTEND_RECURSIVE_SHARED_TIMER(Id)
23
+ // - Id is an identifier suitable for use in C++
24
+ //
21
25
// ===----------------------------------------------------------------------===//
22
26
23
27
// / Driver statistics are collected for driver processes
24
28
#ifdef DRIVER_STATISTIC
29
+
30
+ // / Total number of jobs (frontend, merge-modules, link, etc.) run by the
31
+ // / driver. This should be some number less than the total number of files in
32
+ // / the module in primary-files mode, and will likely just be 1 or 2 in WMO
33
+ // / mode.
25
34
DRIVER_STATISTIC (NumDriverJobsRun)
35
+
36
+ // / Total number of jobs (frontend, merge-modules, link, etc.) which _could_
37
+ // / have been run by the driver, but that it decided to skip due to analysis of
38
+ // / the dependency graph induced by .swiftdeps files. This, added together with
39
+ // / the number of driver jobs run (above) should be relatively constant
40
+ // / run-over-run.
26
41
DRIVER_STATISTIC(NumDriverJobsSkipped)
27
42
43
+ // / Next 10 statistics count dirtying-events in the driver's dependency graph,
44
+ // / which it uses to decide which files are invalid (and thus which files to
45
+ // / build). There are two dimensions to each dirtying event:
46
+ // /
47
+ // / - the type of dependency that caused the dirtying (top-level names, dynamic
48
+ // / lookups, nominal type usage, member usage, or external-files)
49
+ // /
50
+ // / - whether the dependency should "cascade" (transitively dirty the node's
51
+ // / own downstream dependents, vs. just dirtying the node itself)
28
52
DRIVER_STATISTIC(DriverDepCascadingTopLevel)
29
53
DRIVER_STATISTIC(DriverDepCascadingDynamic)
30
54
DRIVER_STATISTIC(DriverDepCascadingNominal)
@@ -37,46 +61,119 @@ DRIVER_STATISTIC(DriverDepNominal)
37
61
DRIVER_STATISTIC(DriverDepMember)
38
62
DRIVER_STATISTIC(DriverDepExternal)
39
63
64
+ // / Maximum Resident Set Size (roughly: physical memory actually used) by the
65
+ // / tree of processes launched by the driver (i.e. the entire compilation).
40
66
DRIVER_STATISTIC(ChildrenMaxRSS)
41
67
#endif
42
68
43
69
// / Driver statistics are collected for frontend processes
44
70
#ifdef FRONTEND_STATISTIC
71
+
72
+ // / Number of source buffers visible in the source manager.
45
73
FRONTEND_STATISTIC (AST, NumSourceBuffers)
74
+
75
+ // / Total number of lines of source code (just by counting newlines) in all the
76
+ // / source buffers visible in the source manager. Crude proxy for "project
77
+ // / size".
46
78
FRONTEND_STATISTIC(AST, NumSourceLines)
79
+
80
+ // / The NumSourceLines value of a frontend divided by the user-time of the
81
+ // / frontend; stored and emitted separately so there's a precomputed value a
82
+ // / user can grep-for to find a slow frontend.
47
83
FRONTEND_STATISTIC(AST, NumSourceLinesPerSecond)
84
+
85
+ // / Number of libraries (including frameworks) linked against.
48
86
FRONTEND_STATISTIC(AST, NumLinkLibraries)
87
+
88
+ // / Number of top-level modules loaded in the AST context.
49
89
FRONTEND_STATISTIC(AST, NumLoadedModules)
90
+
91
+ // / Number of external definitions imported into the AST context.
50
92
FRONTEND_STATISTIC(AST, NumImportedExternalDefinitions)
93
+
94
+ // / Number of Clang entities imported into the AST context.
51
95
FRONTEND_STATISTIC(AST, NumTotalClangImportedEntities)
96
+
97
+ // / Number of bytes allocated in the AST's local arenas.
52
98
FRONTEND_STATISTIC(AST, NumASTBytesAllocated)
99
+
100
+ // / Number of file-level dependencies of this frontend job, as tracked in the
101
+ // / AST context's dependency collector.
53
102
FRONTEND_STATISTIC(AST, NumDependencies)
103
+
104
+ // / Number of top-level, dynamic, and member names referenced in this frontend
105
+ // / job's source file, as tracked by the AST context's referenced-name tracker.
54
106
FRONTEND_STATISTIC(AST, NumReferencedTopLevelNames)
55
107
FRONTEND_STATISTIC(AST, NumReferencedDynamicNames)
56
108
FRONTEND_STATISTIC(AST, NumReferencedMemberNames)
109
+
110
+ // / Number of declarations in the AST context.
57
111
FRONTEND_STATISTIC(AST, NumDecls)
112
+
113
+ // / Number of local type declarations in the AST context.
58
114
FRONTEND_STATISTIC(AST, NumLocalTypeDecls)
115
+
116
+ // / Number of Objective-C declarations in the AST context.
59
117
FRONTEND_STATISTIC(AST, NumObjCMethods)
118
+
119
+ // / Number of infix, postfix, and prefix operators in the AST context.
60
120
FRONTEND_STATISTIC(AST, NumInfixOperators)
61
121
FRONTEND_STATISTIC(AST, NumPostfixOperators)
62
122
FRONTEND_STATISTIC(AST, NumPrefixOperators)
123
+
124
+ // / Number of precedence groups in the AST context.
63
125
FRONTEND_STATISTIC(AST, NumPrecedenceGroups)
126
+
127
+ // / Number of conformances used by code processed by this frontend job.
64
128
FRONTEND_STATISTIC(AST, NumUsedConformances)
65
129
130
+ // / Number of conformances that were deserialized by this frontend job.
66
131
FRONTEND_STATISTIC(Sema, NumConformancesDeserialized)
132
+
133
+ // / Number of constraint-solving scopes created in the typechecker, while
134
+ // / solving expression type constraints. A rough proxy for "how much work the
135
+ // / expression typechecker did".
67
136
FRONTEND_STATISTIC(Sema, NumConstraintScopes)
137
+
138
+ // / Number of declarations that were deserialized. A rough proxy for the amount
139
+ // / of material loaded from other modules.
68
140
FRONTEND_STATISTIC(Sema, NumDeclsDeserialized)
141
+
142
+ // / Number of declarations validated.
69
143
FRONTEND_STATISTIC(Sema, NumDeclsValidated)
144
+
145
+ // / Number of full function bodies typechecked.
70
146
FRONTEND_STATISTIC(Sema, NumFunctionsTypechecked)
147
+
148
+ // / Number of generic signature builders constructed. Rough proxy for
149
+ // / amount of work the GSB does analyzing type signatures.
71
150
FRONTEND_STATISTIC(Sema, NumGenericSignatureBuilders)
151
+
152
+ // / Number of lazy generic environments built.
72
153
FRONTEND_STATISTIC(Sema, NumLazyGenericEnvironments)
154
+
155
+ // / Number of lazy generic environments deserialized.
73
156
FRONTEND_STATISTIC(Sema, NumLazyGenericEnvironmentsLoaded)
157
+
158
+ // / Number of lazy iterable declaration contexts constructed.
74
159
FRONTEND_STATISTIC(Sema, NumLazyIterableDeclContexts)
160
+
161
+ // / Number of direct member-name lookups performed on nominal types.
75
162
FRONTEND_STATISTIC(Sema, NominalTypeLookupDirectCount)
163
+
164
+ // / Number of types deserialized.
76
165
FRONTEND_STATISTIC(Sema, NumTypesDeserialized)
166
+
167
+ // / Number of types validated.
77
168
FRONTEND_STATISTIC(Sema, NumTypesValidated)
169
+
170
+ // / Number of lazy iterable declaration contexts left unloaded.
78
171
FRONTEND_STATISTIC(Sema, NumUnloadedLazyIterableDeclContexts)
79
172
173
+ // / The next 10 statistics count 5 kinds of SIL entities present
174
+ // / after the SILGen and SILOpt phases. The entities are functions,
175
+ // / vtables, witness tables, default witness tables and global
176
+ // / variables.
80
177
FRONTEND_STATISTIC(SILModule, NumSILGenFunctions)
81
178
FRONTEND_STATISTIC(SILModule, NumSILGenVtables)
82
179
FRONTEND_STATISTIC(SILModule, NumSILGenWitnessTables)
@@ -89,6 +186,10 @@ FRONTEND_STATISTIC(SILModule, NumSILOptWitnessTables)
89
186
FRONTEND_STATISTIC(SILModule, NumSILOptDefaultWitnessTables)
90
187
FRONTEND_STATISTIC(SILModule, NumSILOptGlobalVariables)
91
188
189
+ // / The next 9 statistics count kinds of LLVM entities produced
190
+ // / during the IRGen phase: globals, functions, aliases, ifuncs,
191
+ // / named metadata, value and comdat symbols, basic blocks,
192
+ // / and instructions.
92
193
FRONTEND_STATISTIC(IRModule, NumIRGlobals)
93
194
FRONTEND_STATISTIC(IRModule, NumIRFunctions)
94
195
FRONTEND_STATISTIC(IRModule, NumIRAliases)
@@ -99,11 +200,18 @@ FRONTEND_STATISTIC(IRModule, NumIRComdatSymbols)
99
200
FRONTEND_STATISTIC(IRModule, NumIRBasicBlocks)
100
201
FRONTEND_STATISTIC(IRModule, NumIRInsts)
101
202
203
+ // / Number of bytes written to the object-file output stream
204
+ // / of the frontend job, which should be the same as the size of
205
+ // / the .o file you find on disk after the frontend exits.
102
206
FRONTEND_STATISTIC(LLVM, NumLLVMBytesOutput)
103
207
#endif
104
208
105
209
// / Frontend timers for recursive routines
106
210
#ifdef FRONTEND_RECURSIVE_SHARED_TIMER
211
+
212
+ // / Time spent in NominalTypeDecl::lookupDirect.
107
213
FRONTEND_RECURSIVE_SHARED_TIMER (NominalTypeDecl__lookupDirect)
214
+
215
+ // / Time spent in ClangImporter::Implementation::loadAllMembers.
108
216
FRONTEND_RECURSIVE_SHARED_TIMER(ClangImporter__Implementation__loadAllMembers)
109
217
#endif
0 commit comments