-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
_config_to_get_to_right() in base.py:457-459 contains a self-acknowledged inefficiency:
# This creates a new HConfigChild object just in case there are some delta children.
# This is not very efficient, think of a way to not do this.
subtree = delta.instantiate_child(target_child.text)A temporary HConfigChild is created for every matching child during remediation computation, even when there turn out to be no delta children. The object is only appended to delta if it has children (line 462), meaning many of these allocations are wasted.
Possible Approaches
- Defer child creation — check if there would be children before creating the subtree node
- Use a lightweight sentinel/proxy object instead of a full
HConfigChildfor the probe - Add the child optimistically and remove it if empty (current approach, but reversed)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request