mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Performance improvements
* Speed up serialization of hostvars by simply using the internal dictionary used for cached lookups * Use blocking gets/puts on queues instead of spin locking * Merge sequential implicitly created blocks
This commit is contained in:
parent
1d402ae390
commit
e7b2308b66
5 changed files with 57 additions and 42 deletions
|
@ -52,7 +52,13 @@ def load_list_of_blocks(ds, play, parent_block=None, role=None, task_include=Non
|
|||
variable_manager=variable_manager,
|
||||
loader=loader
|
||||
)
|
||||
block_list.append(b)
|
||||
# Implicit blocks are created by bare tasks listed in a play withou
|
||||
# an explicit block statement. If we have two implicit blocks in a row,
|
||||
# squash them down to a single block to save processing time later.
|
||||
if b._implicit and len(block_list) > 0 and block_list[-1]._implicit:
|
||||
block_list[-1].block.extend(b.block)
|
||||
else:
|
||||
block_list.append(b)
|
||||
|
||||
return block_list
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue