mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Some notes on optimizing module_replacer
This commit is contained in:
parent
68880a797d
commit
dc9b36ccb0
1 changed files with 10 additions and 0 deletions
|
@ -140,6 +140,16 @@ def modify_module(module_path, module_args, strip_comments=False):
|
||||||
which results in the inclusion of the common code from powershell.ps1
|
which results in the inclusion of the common code from powershell.ps1
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
### TODO: Optimization ideas if this code is actually a source of slowness:
|
||||||
|
# * Fix comment stripping: Currently doesn't preserve shebangs and encoding info (but we unconditionally add encoding info)
|
||||||
|
# * Use pyminifier if installed
|
||||||
|
# * comment stripping/pyminifier needs to have config setting to turn it
|
||||||
|
# off for debugging purposes (goes along with keep remote but should be
|
||||||
|
# separate otherwise users wouldn't be able to get info on what the
|
||||||
|
# minifier output)
|
||||||
|
# * Only split into lines and recombine into strings once
|
||||||
|
# * Cache the modified module? If only the args are different and we do
|
||||||
|
# that as the last step we could cache sll the work up to that point.
|
||||||
|
|
||||||
with open(module_path) as f:
|
with open(module_path) as f:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue