Commit 4f3501f
committed
Try to call Override less
Eliminate a kwarg 'explain' from the call to Builder() for Mkdir. Arg is
not used (maybe it was in the past, though have not found the evidence
for this), which meant we had an override dict in this case. Suprisingly,
this ended up in the override logic a *lot* in a build of a large sample
project - over 2000 extra calls to scons_subst_once that weren't needed.
Builder and Executor both have places where they call Override().
While the Override factory indeed returns quickly if the override dict
is empty, avoid the function call entirely in this case by checking
(there was an old TODO comment to this effect in Builder.__init__.py).
The Executor init method declared multiple paramters with mutable
defaults, which means they "persist". While there's no evidence this
is calling a real problem, eliminate part of this footgun by defaulting
overridelist and builder_kw to None and checking for that (targets and
sources still default to a mutable empty list, a TBD perhaps).
Signed-off-by: Mats Wichmann <[email protected]>1 parent 8c15e8c commit 4f3501f
File tree
6 files changed
+28
-19
lines changed- SCons
- Node
6 files changed
+28
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
674 | | - | |
| 673 | + | |
| 674 | + | |
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
863 | 865 | | |
864 | | - | |
| 866 | + | |
| 867 | + | |
865 | 868 | | |
866 | 869 | | |
867 | 870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
| 171 | + | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
| |||
358 | 355 | | |
359 | 356 | | |
360 | 357 | | |
361 | | - | |
| 358 | + | |
362 | 359 | | |
363 | 360 | | |
364 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
| |||
0 commit comments