Closed jrdnr closed 6 years ago
I've been meaning to do something very similar to this so just wanted yes to share a thought. It might a good idea to invalidate the cache everytime a change is made, i.e. as part of a successful set-targetresourse call.
I might be wrong but I think after a set is triggered another test is immediately after so this would be important for reporting up correctly without a 60 second wait.
@ferventcoder moving to a cache dir is an easy change, I can run a couple thousand iterations and let you know later tonight about the json vs XML Q.
@mrhockeymonkey that's a good idea.. I'll take a look at that part of the code and see if I can see a good way to do it. Will follow up later tonight
Well @ferventcoder I can't really ensure I did it the absolute fastest way, however running 10,000 iterations of the Get-ChocoInstalledPackage the way I have it currently using *-Clixml
took about 18 seconds. Using ConvertFrom-Json
/ConvertTo-Json
was almost another half as long, at over 25 seconds.
here are my tests if anyone cares to review: https://gist.github.com/jrdnr/3905c9f1a49326730ab3687155e97e54
@ferventcoder All applicable suggested updates have been made, let me know if there is anything else that maybe should have been considered before accepting the pull request.
thanks
The commits do need cleaned up, I can handle that or you can. I am going to need to back out that merge commit - merge commits in branches are bad. Please use rebase (like fetch and rebase) and never pull or merge - merging typically only happens in long-lived branches, like merging this code into master or development and syncing up those two branches). HTH
I've spent years getting git pull
out of people's vocabulary. It's not good for the open source model and multiple forks.
Sorry for the poor git manners, and thanks for the explanation. I'm just learning git and haven't quite gotten my head around the proper way to do these patches.
I might have to let you clean up this one since I'm not entirely sure exactly what right looks like and I'll try to learn how to do it right before I hand you another mess to clean up.
just wanted to say - this is incredible in terms of performance.
We run a forked version of this resource and ive just merged your changes into that and its stupidly fast now. Configuration enactment down from 20 minutes to 2 ish. so thank you.
@jrdnr I can do it, or possibly we can pair on it. That way you get some experience with this
@ferventcoder pairing would be great, I'd really appreciate getting a little better understanding of git and how to go back and fix things
@jrdnr send an email to my github username at gmail with your timezone and availability.
For finding a time, it should take around 20-30 min or less.
Awesome work, this will be in the next version!
This commit will allow the Installed package list to be cached locally in the $env:ChocolateyInstall folder for 60 seconds before pulling a new list.