kelleyma49 / PSFzf

A PowerShell wrapper around the fuzzy finder fzf
MIT License
787 stars 34 forks source link

Enabling aliases is very slow #73

Closed srid closed 2 years ago

srid commented 3 years ago

I add the following to my PS init script to enable aliases on all shells:

echo "Loading aliases ..."
Enable-PsFzfAliases
echo "Done."

However this slows down the shell initialization by several seconds (5s). Any way to speed things up here?

srid commented 3 years ago
> Measure-Command { Enable-PsFzfAliases }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 4
Milliseconds      : 308
Ticks             : 43080303
TotalDays         : 4.98614618055556E-05
TotalHours        : 0.00119667508333333
TotalMinutes      : 0.071800505
TotalSeconds      : 4.3080303
TotalMilliseconds : 4308.0303
kelleyma49 commented 3 years ago

Try using Set-PsFzfOption. You need to explicitly specify which aliases you want to enable, but it should speed up load time.

Enabe-PsFzfAliases needs to do more checking to prevent clashing with exes in your %PATH%.