diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-10-10 21:20:30 +0100 |
---|---|---|
committer | Richard Ipsum <richardipsum@fastmail.co.uk> | 2014-10-10 21:27:23 +0100 |
commit | ec09b9d5476fa313d1b43ee02bc773d195ef98e8 (patch) | |
tree | c46c50080f6b6cb3e628a589502a00c29dbf1113 /morphlib | |
parent | 120b16734079e5899b04f76a8c3c37c9a3ae8b3a (diff) | |
download | morph-ec09b9d5476fa313d1b43ee02bc773d195ef98e8.tar.gz |
Remove queueing
Artifact resolution is no longer recursive, so there's no need to requeue
sources, removing this queue provides a significant speed up. Fixing an
issue where artifact resoltuion was taking too long on some systems
(several minutes in some cases).
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/artifactresolver.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py index 8c8b37d0..168c122c 100644 --- a/morphlib/artifactresolver.py +++ b/morphlib/artifactresolver.py @@ -82,7 +82,7 @@ class ArtifactResolver(object): self._added_artifacts.add(system) resolved_artifacts = self._resolve_system_dependencies( - systems, source, queue) + systems, source) for artifact in resolved_artifacts: if not artifact in self._added_artifacts: @@ -105,7 +105,7 @@ class ArtifactResolver(object): self._added_artifacts.add(stratum) resolved_artifacts = self._resolve_stratum_dependencies( - strata, source, queue) + strata, source) for artifact in resolved_artifacts: if not artifact in self._added_artifacts: @@ -126,15 +126,9 @@ class ArtifactResolver(object): return artifacts def _create_initial_queue(self): - if all([x.morphology['kind'] == 'chunk' for x in self._source_pool]): - return collections.deque(self._source_pool) - else: - sources = [x for x in self._source_pool - if x.morphology['kind'] != 'chunk'] - return collections.deque(sources) - - def _resolve_system_dependencies(self, systems, - source, queue): # pragma: no cover + return collections.deque(self._source_pool) + + def _resolve_system_dependencies(self, systems, source): # pragma: no cover artifacts = [] for info in source.morphology['strata']: @@ -156,11 +150,9 @@ class ArtifactResolver(object): source.add_dependency(stratum_artifact) artifacts.append(stratum_artifact) - queue.append(stratum_source) - return artifacts - def _resolve_stratum_dependencies(self, strata, source, queue): + def _resolve_stratum_dependencies(self, strata, source): artifacts = [] stratum_build_depends = [] @@ -191,8 +183,6 @@ class ArtifactResolver(object): source.add_dependency(other_stratum) - queue.append(other_source) - # 'name' here is the chunk artifact name name_to_processed_artifacts = {} |