summaryrefslogtreecommitdiff
path: root/jstests/SConscript
diff options
context:
space:
mode:
authorAndrew Morrow <andrew.morrow@10gen.com>2019-10-14 22:46:31 +0000
committerevergreen <evergreen@mongodb.com>2019-10-14 22:46:31 +0000
commit2f4e03bbca3bf265eca475eb53a2f2dba3897ce2 (patch)
tree7732ba7e16681df4308ea34679550dda9603311b /jstests/SConscript
parent0dbb2c431bcec5f66cfefbebff655730d989a8d4 (diff)
downloadmongo-2f4e03bbca3bf265eca475eb53a2f2dba3897ce2.tar.gz
SERVER-43730 Small build system speed improvements
These should speed up all SCons startup tasks for both vanilla SCons and Ninja generation
Diffstat (limited to 'jstests/SConscript')
-rw-r--r--jstests/SConscript16
1 files changed, 13 insertions, 3 deletions
diff --git a/jstests/SConscript b/jstests/SConscript
index c9aa97ef785..6c74052db81 100644
--- a/jstests/SConscript
+++ b/jstests/SConscript
@@ -1,5 +1,8 @@
# Includes the jstests in distribution tarballs generated by SCons
+import os
+from collections import defaultdict
+
Import("env")
Import("get_option")
@@ -8,10 +11,17 @@ env = env.Clone()
if not get_option("install-mode") == "hygienic":
Return()
-for jstest in env.Glob("**/*.js"):
+jstests = env.Glob("**/*.js")
+
+# Group by directory to avoid making a million calls to AutoInstall
+jstests_by_dir = defaultdict(list)
+for jstest in jstests:
+ jstests_by_dir[jstest.dir].append(jstest)
+
+for directory, files in jstests_by_dir.items():
env.AutoInstall(
- target="$PREFIX_SHAREDIR/jstests/" + str(jstest.dir),
- source=jstest,
+ target="$PREFIX_SHAREDIR/jstests/" + str(directory),
+ source=files,
AIB_COMPONENT="jstests",
AIB_ROLE="runtime",
AIB_COMPONENTS_EXTRA=[