Due to unfortunate copy-pasta, the original implementation of
function.dep_attrs() iterates over items in a dictionary instead of values.
Dictionary keys cannot have dependencies - they must be hashable and
Function objects are not. So for each dictionary key we call dep_attrs()
recursively 3 times as many times as we need to (for the key/value tuple,
the key, and the value). For template snippets that are dominated by
dictionaries, this means it took three times as long and used three times
as much memory and twice as much stack space as it needed to.
Change-Id: I13781540483daf88202d221a9f517746eebf0346
Partial-Bug: #1684272
(cherry picked from commit c889f08ab5279caae3d6fe4e0614fa938fb2c9ff)
Reviewed: https:/ /review. openstack. org/487605 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=0b934bf8609 b631e24bdb0a09c 090dabeef75e13
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 0b934bf8609b631 e24bdb0a09c090d abeef75e13
Author: Zane Bitter <email address hidden>
Date: Wed Jul 19 17:35:40 2017 -0400
Optimise the function. dep_attrs( ) function
Due to unfortunate copy-pasta, the original implementation of dep_attrs( ) iterates over items in a dictionary instead of values.
function.
Dictionary keys cannot have dependencies - they must be hashable and
Function objects are not. So for each dictionary key we call dep_attrs()
recursively 3 times as many times as we need to (for the key/value tuple,
the key, and the value). For template snippets that are dominated by
dictionaries, this means it took three times as long and used three times
as much memory and twice as much stack space as it needed to.
Change-Id: I13781540483daf 88202d221a9f517 746eebf0346 ae3d6fe4e0614fa 938fb2c9ff)
Partial-Bug: #1684272
(cherry picked from commit c889f08ab5279ca