Slowness with `LP_ENABLE_GIT=1`
Created by: FedericoStra
Shell: 5.1.8(1)-release
Liquidprompt version: v2.0.3
Operating system:
[:~] $ uname -a
Linux xps15 5.16.5-200.fc35.x86_64 #1 SMP PREEMPT Tue Feb 1 21:37:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[:~] $ cat /proc/version
Linux version 5.16.5-200.fc35.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7), GNU ld version 2.37-10.fc35) #1 SMP PREEMPT Tue Feb 1 21:37:11 UTC 2022
[:~] $ cat /etc/*release
Fedora release 35 (Thirty Five)
NAME="Fedora Linux"
VERSION="35 (Workstation Edition)"
ID=fedora
VERSION_ID=35
VERSION_CODENAME=""
PLATFORM_ID="platform:f35"
PRETTY_NAME="Fedora Linux 35 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:35"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=35
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=35
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 35 (Thirty Five)
Fedora release 35 (Thirty Five)
Steps to Reproduce
- Have
LP_ENABLE_GIT=1
set in.config/liquidpromptrc
-
cd
to a Git repository
Expected Behavior
Nothing special, just the prompt promptly appearing.
Current Behavior
The prompt takes around 1 second to display.
For instance, if I cd ~/.liquidprompt
(which is a Git repo) and just press Enter in the terminal, each of the following lines takes approximately 1 second to appear:
[:~/.liquidprompt] stable ±
[:~/.liquidprompt] stable ±
[:~/.liquidprompt] stable ±
[:~/.liquidprompt] stable ±
Possible Solution
My suspicion is that some of the _lp_git_*
functions take a long time to execute, but I haven't been able to figure out which.