justjanne / powerline-go

A beautiful and useful low-latency prompt for your shell, written in go
GNU General Public License v3.0
2.74k stars 270 forks source link

Latency #129

Open clbarnes opened 5 years ago

clbarnes commented 5 years ago

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 commented 5 years ago

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

clbarnes commented 5 years ago

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 commented 5 years ago

Wsl 2. Actually, on wsl 1, its very much bearable.

On Mon, Aug 12, 2019 at 5:55 PM Chris Barnes notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justjanne/powerline-go/issues/129?email_source=notifications&email_token=AAEZETXXAOFPTKFO2JNQMUDQEE6RJA5CNFSM4HIPUU7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CFWRQ#issuecomment-520379206, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEZETUC65QGB4M5SLOGR2DQEE6RJANCNFSM4HIPUU7A .

tuananh commented 5 years ago

hmm, it seems it's issue with WSL

the issue happens when i'm on /mnt

https://github.com/microsoft/WSL/issues/4197

82phil commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

justjanne commented 4 years ago

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

audunmg commented 4 years ago

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 commented 2 years ago

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

82phil commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 months ago

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