GitScripts icon indicating copy to clipboard operation
GitScripts copied to clipboard

Does parallelizing work?

Open miltoncandelero opened this issue 3 years ago • 1 comments

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?

miltoncandelero avatar May 31 '22 14:05 miltoncandelero

In theory if you have a lot of locked files it could speed things up, provided:

  1. The server doesn't object to being hit by lots of parallel API requests
  2. 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 🤷‍♂️

sinbad avatar May 31 '22 15:05 sinbad