@@ -94,14 +94,13 @@ in the current build. This is covered by checking if the input has been
94
94
modified since the last build; if it hasn't, we only need to recompile if
95
95
something it depends on has changed.
96
96
97
-
98
- Execute: Running the Jobs in a Compilation using a TaskQueue
99
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
+ Schedule: Ordering and skipping jobs by dependency analysis
98
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
99
101
100
A Compilation's goal is to make sure every Job in its list of Jobs is handled.
102
101
If a Job needs to be run, the Compilation attempts to *schedule * it. If the
103
102
Job's dependencies have all been completed (or determined to be skippable), it
104
- is added to the TaskQueue ; otherwise it is marked as *blocked. *
103
+ is scheduled for execution ; otherwise it is marked as *blocked. *
105
104
106
105
To support Jobs compiling individual Swift files, which may or may not need to
107
106
be run, the Compilation keeps track of a DependencyGraph. (If file A depends on
@@ -111,6 +110,22 @@ that were directly blocked on it, and check to see if any other Jobs now need
111
110
to run based on the DependencyGraph. See the section on :doc: `DependencyAnalysis `
112
111
for more information.
113
112
113
+ Batch: Optionally combine similar jobs
114
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
+
116
+ The Driver has an experimental "batch mode" that examines the set of scheduled
117
+ jobs just prior to execution, looking for jobs that are identical to one another
118
+ aside from the primary input file they are compiling in a module. If it finds
119
+ such a set, it may replace the set with a single BatchJob, before handing it off
120
+ to the TaskQueue; this helps minimize the overall number of frontend processes
121
+ that run (and thus do potentially redundant work).
122
+
123
+ Once any batching has taken place, the set of scheduled jobs (batched or
124
+ otherwise) is transferred to the TaskQueue for execution.
125
+
126
+ Execute: Running the Jobs in a Compilation using a TaskQueue
127
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
+
114
129
The Compilation's TaskQueue controls the low-level aspects of managing
115
130
subprocesses. Multiple Jobs may execute simultaneously, but communication with
116
131
the parent process (the driver) is handled on a single thread. The level of
0 commit comments