Skip to content

Commit d62e6e2

Browse files
committed
ansible: serialize calls to ModuleDepService.
Concurrent calls to ModuleDepService would cause significant wasted work, as potentially all pool threads run the same uncached module dep scan. Without: 3243581 function calls (3233009 primitive calls) in 4770.672 seconds ncalls tottime percall cumtime percall filename:lineno(function) 2523 0.011 0.000 39.849 0.016 services.py:409(scan) With: 2801561 function calls (2800042 primitive calls) in 5166.843 seconds ncalls tottime percall cumtime percall filename:lineno(function) 2506 0.009 0.000 1.967 0.001 services.py:411(scan) Ignore timing variance due to problems with the test job.
1 parent a05835c commit d62e6e2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ansible_mitogen/services.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ class ModuleDepService(mitogen.service.Service):
388388
Scan a new-style module and produce a cached mapping of module_utils names
389389
to their resolved filesystem paths.
390390
"""
391+
invoker_class = mitogen.service.SerializedInvoker
392+
391393
def __init__(self, *args, **kwargs):
392394
super(ModuleDepService, self).__init__(*args, **kwargs)
393395
self._cache = {}

0 commit comments

Comments
 (0)