mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21: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 |
||
---|---|---|
.. | ||
module_docs_fragments | ||
__init__.py | ||
cmd_functions.py | ||
display_functions.py | ||
module_docs.py | ||
plugins.py | ||
string_functions.py | ||
template.py | ||
vault.py |