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 /tests/internals/yaml.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 'tests/internals/yaml.py')
-rw-r--r-- | tests/internals/yaml.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py index b2d96256d..a7b4457e3 100644 --- a/tests/internals/yaml.py +++ b/tests/internals/yaml.py @@ -124,9 +124,9 @@ def test_node_get(datafiles): assert (exc.value.reason == LoadErrorReason.INVALID_DATA) -# Really this is testing _yaml.node_chain_copy(), we want to -# be sure that when using a ChainMap copy, compositing values -# still preserves the original values in the copied dict. +# Really this is testing _yaml.node_copy(), we want to +# be sure that compositing values still preserves the original +# values in the copied dict. # @pytest.mark.datafiles(os.path.join(DATA_DIR)) def test_composite_preserve_originals(datafiles): @@ -140,7 +140,7 @@ def test_composite_preserve_originals(datafiles): base = _yaml.load(filename) overlay = _yaml.load(overlayfile) - base_copy = _yaml.node_chain_copy(base) + base_copy = _yaml.node_copy(base) _yaml.composite_dict(base_copy, overlay) copy_extra = _yaml.node_get(base_copy, Mapping, 'extra') |