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

Default Cmder install is very slow inside a large Git repo #1364

Closed
seanofw opened this issue May 4, 2017 · 6 comments
Closed

Default Cmder install is very slow inside a large Git repo #1364

seanofw opened this issue May 4, 2017 · 6 comments
Labels
👀 Awaiting Response Waiting to hear back from the issue reporter.

Comments

@seanofw
Copy link

seanofw commented May 4, 2017

I just downloaded and installed Cmder for the first time. I opened it, typed ls a few times, and then cd'ed into one of my repositories at work, and... nothing. I thought it had broken, but after a little poking, I discovered that in fact it was merely extremely slow.

It appears that whatever trick the prompt uses to display the current Git branch takes quite some time to load on a large repository, and it just so happened that my first tests were inside a large repository: More than a gigabyte of source code, scattered across ~50,000 files and ~10,000 directories.

I'm used to git status taking a few seconds in this repo when I run it, but I'm not used to every command, even simple things like ls and cd, taking an extra four seconds (literally) after it completes. I'm pretty sure it's the prompt's Git integration, since it only seems to happen in this (admittedly huge) repository; anywhere else in the filesystem, it's fine and runs at full speed.

A possible reasonable workaround might be changing the prompt so it just shows the current branch name (fast), rather than trying to determine the current code's commit status (slow).

But for me, the default configuration of Cmder out-of-the-box is nearly unusable, with no obvious way to fix it. There are a few older pages online that describe how to change the prompt (which I'd hoped to do to simply remove the Git status outright), but they seem to only apply to older versions of Cmder: I have 161206 stable, and the configuration files they talk about don't seem to exist, much less be editable.

So how can I make Cmder usable when working inside a large Git repository?

@centur
Copy link

centur commented May 12, 2017

Check file vendor/profile.ps1 if you're using powershell as your main console.
The function of interest is around line 63 (Cmder mini) - function checkGit($Path)
and then it's invoked in line 113 in CmderPrompt script block like checkGit($pwd.ProviderPath)

You can override script blocks in your user profile file, which gets included into main profile so you will preserve your customizations between upgrades.

Or for Cmd promp you need to look into clink.lua, but it's up to you to figure out how to fix it in lua, I don't use classic cmd prompt

@mloskot
Copy link

mloskot commented Apr 10, 2018

@seanofw For the clink.lua, I've just posted another workaround here #447 (comment)

@maybeec
Copy link

maybeec commented Aug 8, 2018

The coloring most probably should be an opt-out to not work in the lua code anymore. But it definitely saved my day already! Thanks @mloskot for the pointer

@ta32
Copy link

ta32 commented Aug 23, 2018

its also happening inside and SVN directory, cd is extremely slow and ls hangs as well

@stale
Copy link

stale bot commented May 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contribution.

@stale stale bot added the 👀 Awaiting Response Waiting to hear back from the issue reporter. label May 25, 2019
@stale
Copy link

stale bot commented Jun 1, 2019

This issue has been automatically closed due to it not having any activity since it was marked as stale. Thank you for your contribution.

@stale stale bot closed this as completed Jun 1, 2019
@daxgames daxgames mentioned this issue Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 Awaiting Response Waiting to hear back from the issue reporter.
Projects
None yet
Development

No branches or pull requests

5 participants