community.general/lib/ansible/utils
Grzegorz Nosek 7f33580eba Fix exponential regex performance issue
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
2014-08-01 14:46:00 +02:00
..
module_docs_fragments Use file documentation fragement for the copy module 2014-06-16 15:36:15 -05:00
__init__.py Fix exponential regex performance issue 2014-08-01 14:46:00 +02:00
cmd_functions.py Fixes #3973 Second Revision of live ansible-pull output 2014-01-10 11:18:02 -05:00
display_functions.py Moving display-related functions to new module in utils 2014-04-30 15:33:46 -05:00
module_docs.py Fixes #6894 add missing file and remove debug line 2014-04-08 13:22:23 -04:00
plugins.py powershell modules will have a .ps1 extension 2014-06-19 14:24:13 -05:00
string_functions.py Allow isprintable() util function to work with unicode 2014-04-03 15:29:51 -05:00
template.py Revert "template.py: Handle purposely raised exceptions in lookup()" 2014-07-28 23:25:37 -05:00
vault.py Make sure umask is set restrictively before creating any vault files 2014-04-18 13:38:59 -05:00