diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-03-06 17:09:26 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-14 14:39:37 +0000 |
commit | 0535961695ee4b0185ded67bcba233e73209cfb7 (patch) | |
tree | 9bb05e99e2e415e683e5a5ce403d70c4a92b72b7 /buildstream/element.py | |
parent | c991a066ab42b14662a798b7e0fe2dd127672395 (diff) | |
download | buildstream-0535961695ee4b0185ded67bcba233e73209cfb7.tar.gz |
_yaml.py: Rip out ChainMap(), node_chain_copy(), node_list_copy()jennis/remove_node_chain_stuff
This class and these two functions exist as they were intended to
bring efficiency. Benchmarking this patch against the debian-stack.bst
element in the debian-like project [0] showed that although this
took 15M more RAM (peak usage), there was a ~20s gain in the time taken
to 'show' the stack. Thus the class and functions have been removed.
This also has the advantage of removing a lot of duplicate and unnecessary
code.
[0] https://gitlab.com/jennis/debian-stretch-bst
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 901a9507f..d4e4a30ed 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -2357,11 +2357,11 @@ class Element(Plugin): element_splits = _yaml.node_get(element_bst, Mapping, 'split-rules', default_value={}) if self.__is_junction: - splits = _yaml.node_chain_copy(element_splits) + splits = _yaml.node_copy(element_splits) else: assert project._splits is not None - splits = _yaml.node_chain_copy(project._splits) + splits = _yaml.node_copy(project._splits) # Extend project wide split rules with any split rules defined by the element _yaml.composite(splits, element_splits) @@ -2414,7 +2414,7 @@ class Element(Plugin): environment = {} else: project = self._get_project() - environment = _yaml.node_chain_copy(project.base_environment) + environment = _yaml.node_copy(project.base_environment) _yaml.composite(environment, default_env) _yaml.composite(environment, meta.environment) @@ -2454,10 +2454,10 @@ class Element(Plugin): project = self._get_project() if self.__is_junction: - variables = _yaml.node_chain_copy(project.first_pass_config.base_variables) + variables = _yaml.node_copy(project.first_pass_config.base_variables) else: project.ensure_fully_loaded() - variables = _yaml.node_chain_copy(project.base_variables) + variables = _yaml.node_copy(project.base_variables) _yaml.composite(variables, default_vars) _yaml.composite(variables, meta.variables) @@ -2479,7 +2479,7 @@ class Element(Plugin): # The default config is already composited with the project overrides config = _yaml.node_get(self.__defaults, Mapping, 'config', default_value={}) - config = _yaml.node_chain_copy(config) + config = _yaml.node_copy(config) _yaml.composite(config, meta.config) _yaml.node_final_assertions(config) @@ -2495,7 +2495,7 @@ class Element(Plugin): else: project = self._get_project() project.ensure_fully_loaded() - sandbox_config = _yaml.node_chain_copy(project._sandbox) + sandbox_config = _yaml.node_copy(project._sandbox) # Get the platform to ask for host architecture platform = Platform.get_platform() @@ -2504,7 +2504,7 @@ class Element(Plugin): # The default config is already composited with the project overrides sandbox_defaults = _yaml.node_get(self.__defaults, Mapping, 'sandbox', default_value={}) - sandbox_defaults = _yaml.node_chain_copy(sandbox_defaults) + sandbox_defaults = _yaml.node_copy(sandbox_defaults) _yaml.composite(sandbox_config, sandbox_defaults) _yaml.composite(sandbox_config, meta.sandbox) @@ -2530,12 +2530,12 @@ class Element(Plugin): # def __extract_public(self, meta): base_public = _yaml.node_get(self.__defaults, Mapping, 'public', default_value={}) - base_public = _yaml.node_chain_copy(base_public) + base_public = _yaml.node_copy(base_public) base_bst = _yaml.node_get(base_public, Mapping, 'bst', default_value={}) base_splits = _yaml.node_get(base_bst, Mapping, 'split-rules', default_value={}) - element_public = _yaml.node_chain_copy(meta.public) + element_public = _yaml.node_copy(meta.public) element_bst = _yaml.node_get(element_public, Mapping, 'bst', default_value={}) element_splits = _yaml.node_get(element_bst, Mapping, 'split-rules', default_value={}) |