commit 9fb37e4b9b00bd58bd05252357e9b7bd0e466140
parent 64caac4600ec633abae2dc160a9464685bc1bcbe
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Mon, 8 Dec 2025 10:18:37 +0000
Bug 2003239 - Remove unused cruft of DefaultLoader.get_manifests r=jcristau,taskgraph-reviewers
In addition of making the code easier to read, it saves 130ms during
graph construction.
% hyperfine -L branch experiment/try-validate^,experiment/try-validate -w1 -r5 -s 'git checkout {branch}' 'TASKGRAPH_SERIAL=1 ./mach taskgraph full -k mochitest'
Benchmark 1: TASKGRAPH_SERIAL=1 ./mach taskgraph full -k mochitest (branch = experiment/try-validate^)
Time (mean ± σ): 18.761 s ± 0.106 s [User: 19.054 s, System: 2.911 s]
Range (min … max): 18.624 s … 18.915 s 5 runs
Benchmark 2: TASKGRAPH_SERIAL=1 ./mach taskgraph full -k mochitest (branch = experiment/try-validate)
Time (mean ± σ): 18.632 s ± 0.140 s [User: 18.913 s, System: 2.922 s]
Range (min … max): 18.433 s … 18.800 s 5 runs
Summary
TASKGRAPH_SERIAL=1 ./mach taskgraph full -k mochitest (branch = experiment/try-validate) ran
1.01 ± 0.01 times faster than TASKGRAPH_SERIAL=1 ./mach taskgraph full -k mochitest (branch = experiment/try-validate^)
Differential Revision: https://phabricator.services.mozilla.com/D274559
Diffstat:
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/util/chunking.py b/taskcluster/gecko_taskgraph/util/chunking.py
@@ -308,22 +308,13 @@ class DefaultLoader(BaseManifestLoader):
disabled=False, exists=False, filters=filters, **mozinfo
)
- all_manifests = {chunk_by_runtime.get_manifest(t) for t in tests}
-
- active = {}
- for t in active_tests:
- mp = chunk_by_runtime.get_manifest(t)
- dir_relpath = t["dir_relpath"]
- if not mp.startswith(dir_relpath):
- active.setdefault(mp, set()).add(dir_relpath)
- else:
- active.setdefault(mp, set())
-
- skipped = all_manifests - set(active.keys())
+ active_manifests = {chunk_by_runtime.get_manifest(t) for t in active_tests}
+ skipped_manifests = {chunk_by_runtime.get_manifest(t) for t in tests}
+ skipped_manifests.difference_update(active_manifests)
return {
- "active": list(active.keys()),
- "skipped": list(skipped),
+ "active": list(active_manifests),
+ "skipped": list(skipped_manifests),
"other_dirs": {},
}