RamblingCookieMonster / Invoke-Parallel

Speed up PowerShell with simplified multithreading
MIT License
384 stars 88 forks source link

Import-Modules in parallel when session profile loaded? #60

Open Praful opened 5 years ago

Praful commented 5 years ago

Hello

I've noticed that as I've added modules to my $PROFILE script, the startup time to open a PS terminal has increased. PsFZF, in particular is slow and the author knows this.

I import three modules in my $PROFILE:

Import-Module PSFzf -ArgumentList 'Ctrl+t','Ctrl+r'
Import-Module posh-git
Import-Module oh-my-posh

Is there a way to use Invoke-Parallel (or something else) to load these in parallel to speed up terminal start time?

Thanks

vors commented 5 years ago

I doubt that it would help, Invoke-Parallel has an overhead of it's own of about 0.5 sec per job. Also you would likely see problems with marshaling all the imports from invoke-parrallel scopes back to the global scope.

I personally found posh-git the main offender and don't use it because of the bad performance.