Open musm opened 5 years ago
When I measure Import-Module posh-git
I'm seeing about a 1 second load time which is something we should look into. Is this about the same slow down you're seeing? Also, what version of posh-git are you on? You can get that info if you run gmo posh-git
after the module has been imported.
Unfortunately, what you're asking for will not work atm. Before we come up with yet another way to provide settings, I'd like to see if we can improve the module load time.
Yes it's about 1 second, which substantially slows down loading the already slow to start pwsh v6 shell. I'm running the latest version of posh git available from the gallery.
There are two "latest" available. Which one you got depends on whether or not you used the -AllowPrerelease
flag with Install-Module.
> gmo posh-git
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.0 posh-git {Add-PoshGitToProfile, Ad...
I have a PR pending that I think should help shave ~.5 secs off the load time on pwsh. Hopefully I can get the PR merged for the next beta.
any progress?
That PR made it into the current beta. It improved load time a little. There is another PR (#698) that is attempting to re-write our PSM1 file at build-time with all the dot-source files embedded into it (rather than dot-sourcing them). That is supposed to speed up load time a bit more.
Good to know. Yes powershell startup times are still a big problem for me. Any improvements here would for sure be welcome. Thanks for your work.
any status update here?
No progress on this particular issue. I'd rather atm focus on making the module import faster. In particular, we have a catch 22 situation here where you can't set the settings which is based on the type PoshGitPromptSettings
which you don't have access to until after posh-git
has been imported.
@musm I'm curious how you auto load the module in a git directory. The time it takes to initialize the module is just too long. Sometimes it takes 5+ seconds for me. I've been using 1.0.0. Just updated to 1.1.0.
I am using posh-git and it auto loads when entering a directory that is using git.
I'd like to customize several module variables, without having to import the module in my profile since this drastically slows down starting powershell.
Is this possible?
Thanks.