Skip to content

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

Open
adamryczkowski wants to merge 2 commits into
paluh:masterfrom
adamryczkowski:master
Open

Optimization of costly Augeas() invocation, so it doesn't load all modules#12
adamryczkowski wants to merge 2 commits into
paluh:masterfrom
adamryczkowski:master

Conversation

@adamryczkowski

Copy link
Copy Markdown

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
Copy Markdown
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