Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of costly Augeas() invocation, so it doesn't load all modules #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adamryczkowski
Copy link

Initially I thought that the performance hit was from the Augeas invocation around the line 443, but further testing proved the problem was in completely different place.

Now the net speed of running the play with a single augeas task on localhost from over 1.2 sec to the 0.3 sec (and that includes all other overheads associated with invocation of ansible).

(The first pull request had a typo, that's why I had to delete it).

@adamryczkowski
Copy link
Author

The second commit is a further optimization; it reads the filter parameter for the "incl" string. If found, it prevents augeas from loading built-in modules. This way the behaviour is similar to Puppet's.

Unfortunately, I wasn't able to cleanly infer the filter parameter, if the augeas module is used with the commands parameter; (I am only a beginner with Python). User would have to put it separately, like this:

      augeas: >
        commands='match /files/etc/default/lxc-net/LXC_BRIDGE'
        filter=incl

Please, don't merge this commit yet, I'm still testing this (I'll let you know when I'm ready)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant