-
Notifications
You must be signed in to change notification settings - Fork 100
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
Speed boost for cChocoFeature by reading Chocolatey.config XML #124
Comments
Worth noting also we only use this method for Test-TargetResource, Never for Set-TargetResource. |
@mrhockeymonkey Thanks for raising this issue. I'd prefer to stay away from reading Chocolatey config files directly for the reason you mentioned. Having said that Puppet has |
Yep seems fair. Well I'll stick with what I have so far at my own peril. If you do find out and/or want to include this as a separate resource or perhaps a switch to control this behavior then I'm happy to make a PR. If not I'm happy for this to be closed as answered. |
I seem to have accidentally closed this... I had a look at puppet's 'chocolateyfeature' that you mentioned. It looks to me like it does interact with the config file directly rather than through the CLI. See here which points to here It looks to only read features this way and uses the LCI to make changes (as we have done also). See here |
If it's being done that way on other config managers then I'd say it's fine to do it here also. |
Internally we have moved away from cChocoFeature and instead use a custom resource. Our custom resource reads from Chocolatey.config xml to determine if any given feature is enabled rather than running
powershell choco feature
This gives us a pretty reasonable boost in speed for the routine consistency checks. Would you consider us merging our changes upstream to this repo? I can appreciate the idea of reading the config file might not be desired and possible considered anti-pattern
As an idea of speed increase and thus the reason we went this way:
worth noting also 1 seconds isn't exactly bad but we have massively varying number on this which was the other reason we made a custom resource. For instance on my workstation the latter command takes 19 seconds. Something else entirely to look into but nonetheless the xml method is blindingly quick.
Thoughts and feedback welcome
The text was updated successfully, but these errors were encountered: