jbuedel/posh-git — comment on commit 3b67923aa1091d267b8b59a352d0ff258443acc2
File:  line 0
By dahlbyk:

I had also considered trying to run status in the background, but PowerShell doesn't make it easy. I also considered a service with a file system watcher (like TortoiseGit uses), but that feels more complex than should be necessary. My next spike will be to see if libgit2sharp is faster than calling out to git.exe.

One thing that will speed up your prompt is to `git.exe` instead of `git.cmd`. You just have to port some of the settings in `git.cmd` into your PowerShell profile. Something like this:

$GitInstallDir = 'C:\Program Files (x86)\Git'
$Env:Path = "$GitInstallDir\bin;$GitInstallDir\mingw\bin;$Env:Path"
if(!$Env:HOME) { $Env:HOME = "$Env:HOMEDRIVE$Env:HOMEPATH" }
if(!$Env:HOME) { $Env:HOME = $Env:USERPROFILE }

$Env:PLINK_PROTOCOL = 'ssh'

On my system that trimmed around 300ms off every `git` call. You can set `$GitPromptSettings.Debug = $true` to see your timings.