GitScripts
GitScripts copied to clipboard
Does parallelizing work?
I found that we can run stuff in parallel with (from "unlock unchanged")
$filesToUnlock | ForEach-Object -Parallel {
git lfs unlock $_
} -ThrottleLimit 12
But I am not sure if this actually yields any performance gains 🤔 Any insight?
In theory if you have a lot of locked files it could speed things up, provided:
- The server doesn't object to being hit by lots of parallel API requests
- It doesn't just serialize your requests anyway (in practice it's likely semi-serializing them anyway depending on how its database works).
But, I'm not sure it'll be a significant gain. I wouldn't make it the default behaviour in case 1. is a problem in some environments, but if the practical gain was significant I'd be open to adding an option for it.
It's a shame the unlock api doesn't support including multiple files in a single request, that would be the best for everyone. However most of the time I either don't have that many files locked to make a huge difference, or I just run the unlock script as a post-push that I'm not really waiting on anyway, so 🤷♂️