Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latency #129

Open
clbarnes opened this issue Apr 25, 2019 · 14 comments · May be fixed by #358
Open

Latency #129

clbarnes opened this issue Apr 25, 2019 · 14 comments · May be fixed by #358

Comments

@clbarnes
Copy link

Out of interest, what latencies are other users seeing, for what arguments? You can find out (if you have time installed) by changing your _update_ps1 function like this:

function _update_ps1() {
    echo "powerline"
    time PS1="$(your powerline-go command)"
}

I have powerline-go taking 100-200ms, with the command

powerline-go -colorize-hostname -condensed -cwd-mode plain -priority 'root,cwd-path,exit,user,host,ssh,perms,git-branch,jobs,git-status' -error $?

e.g. when cding into a directory with no python environment:

real	0m0.108s
user	0m0.062s
sys	0m0.051s

And when cding into a directory with a python environment:

real	0m0.191s
user	0m0.112s
sys	0m0.096s

It's not much in the grand scheme of things, but it's a bit of a pain given it's added to every command run! I was just wondering whether my experience was typical.

@tuananh
Copy link

tuananh commented Aug 12, 2019

yeah the delay is quite noticable when I use Windows Subsystem Linux Not much so on macOS

@clbarnes
Copy link
Author

Are you using WSL 1 or WSL 2 preview? WSL 1 has serious issues with file IO speed, among other things, so basically anything involving git is very slow.

@tuananh
Copy link

tuananh commented Aug 12, 2019 via email

@tuananh
Copy link

tuananh commented Aug 22, 2019

hmm, it seems it's issue with WSL

the issue happens when i'm on /mnt

microsoft/WSL#4197

@82phil
Copy link

82phil commented Dec 4, 2019

Late to the party here but found that git stash list was resulting in ~250ms delay for powerline while in a git repo. Using WSL1 on 1909 on Ubuntu 18.04 LTS. I have a patch applied to check if any stashes exist before pulling the list which avoids that issue.

Here are my timings
image

I will get a pull request up sometime later for the git stash delay.

@justjanne
Copy link
Owner

The latency should be improved quite a bit now, as I changed the way git stashes and jobs are determined. If you could please test with the latest version, that’d be great :)

@82phil
Copy link

82phil commented Dec 17, 2019

Performance is much improved. It also doesn't regress with stashes 👍
image

@justjanne
Copy link
Owner

And thanks to the parallel segment PR, performance should now be even better :)

@audunmg
Copy link

audunmg commented May 22, 2020

It is significantly faster for me.

Mercurial adds 250ms of latency for me, but I don't see a clean way of fixing that outside of mercurial itself

@ysiivan
Copy link

ysiivan commented Nov 30, 2021

Very pronounced lag in WSL2 Ubuntu, unusable.
Quite noticeable in PowerShell Core, but not too bad.
Fine in Linux.

@82phil
Copy link

82phil commented Dec 2, 2021

@ysiivan Are you using Windows or Linux directories in WSL2. There is a pretty considerable hit using the Windows side in WSL2.
image

For reference, this is how mine is configured: https://github.com/82phil/workstation/blob/main/wsl/home/.bash_additions#L7

@ysiivan
Copy link

ysiivan commented Dec 2, 2021

@82phil Yes, using it on the windows directories in WSL2 is really bad. I'd be very happy with your times. However, even with
your config, it is way worse.
image

Non windows folders
image

For comparison, I gave a quick try to a Rust built implementation. It was faster, though likely not doing all that this one does. Still not fast enough on WSL2 windows mounted folders.

@82phil
Copy link

82phil commented Dec 3, 2021

@ysiivan Does this only happen in Git repos? My previous post was unintentionally misleading, those repos that I showed don't have much in them. If I use a decently sized project like Ruby on Rails I get your kind of numbers. Even using git status shows a large difference in performance when in the Linux file system vs Windows.
image

WSL2 file performance in Windows directories is abysmal if your churning through a lot of files. Can you move your files over to the Linux file system in WSL2?

@aleen42
Copy link

aleen42 commented Aug 12, 2024

No progress? It seems a great choice to use git.exe when under a Windows file system folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants