mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-29 19:50:25 -07:00
filter_leading_non_json_lines effectively does re.match(".*\w+=\w+.*", line) for every line of output. This has abysmal performance in case of large Base64-encoded data (which ultimately does not match the regex but does match the .*\w+= part) as returned e.g. by the template module (diffs). Replacing the match with re.search("\w=\w", line) drops the complexity back to linear, and actually usable with large diffs from the template module (a 150 KB Base64 diff kept Ansible spinning at 100% cpu for minutes). Also, check the easy cases (line.startswith) first while we're here. Closes: #8932 |
||
---|---|---|
.. | ||
callback_plugins | ||
inventory | ||
module_utils | ||
playbook | ||
runner | ||
utils | ||
__init__.py | ||
callbacks.py | ||
color.py | ||
constants.py | ||
errors.py | ||
module_common.py |