cmder: cmder is extremely slow

Hi,

Cmder is very slow (I don’t know if it’s only me or not, I guess not).

  • It takes about 6 seconds to open a new tab (cmd/powershell with the injections)
  • 1.5-2 seconds to get output after pressing enter (even if it was an empty command. just pressing enter)
  • The thing that takes most of the time from what I’ve seen, is the process of what cmder.lua does. Without it it takes significant less time to do simple operations (still not speedy as regular cmd or cygwin, but reasonable).
  • I didn’t pass through the script to see what it does (except setting some settings) but another thing that happens is that when I press enter I can see the tab name changing to git.exe and going back to cmd.exe afterwards. This process which I don’t know yet why it’s happening also slows it down a lot.

Hope those are things that can be fixed!

Please tell me if there’s something I can check to help with that. It’s a great tool and it’s frustrating that I can’t use it.

Thanks! ☀️ Ariel



If needed, I can record my screen while doing simple actions to demonstrate it 📹 💻

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 48
  • Comments: 79 (20 by maintainers)

Most upvoted comments

I solve the problem. I just installed Linux and… problem solved!! 😃

I tried a few more times to reinstall cmder, now I’m with 1.3 pre and it’s pretty much fine compared to what I had before. On 1.2 I encountered the most slowness in git folders (not that others were fast…).

Anyway, I still think it can be better, the problem is that I don’t know what affects the slowness of cmder, maybe it’s some settings, another programs etc.

If you also have this problem, react with 👍 on the issue itself, that way not all of the participants will get notifications for every +1 comment!

on my personal computer (windows 10) it’s extremely slow, but on my work computer (windows 7) it’s pretty fine.

This ticket is closed but seems like this is still happening, at least for me it happens on a daily basis, super slow to open new tabs and to perform simple things such as an ls.

No fair… I get i7 process and 16GB memory with 0s cmd start up time…

It takes me more than 40 seconds to start cmder in a non git directory. I have no idea why it is soooooooo slow.

just remove those function calls , and hard code all env, since you know the very git_install location. My demo, https://github.com/doglex/Light_Weapon/blob/master/cmder/vendor/init.bat

which is fast 0.5s in HDD 0.1s in SSD

Turning off Windows Defender helped a lot for me.

i think the culprit is the function

get_git_status()

function get_git_status()
    local file = io.popen("git status --no-lock-index --porcelain 2>nul")
    for line in file:lines() do
        file:close()
        return false
    end
    file:close()
    return true
end

I read that it will takes up so much time https://gist.github.com/sindresorhus/3898739#gistcomment-1897703 and the fastest is this one … it makes a lot faster 😃

function get_git_status()
    return os.execute("git diff-files --no-ext-diff --quiet")
end

I just replace below line with return false to speed up. https://github.com/cmderdev/cmder/blob/master/config/cmder.lua#L61

Same here

Also for me it works really - my version 1.3.11.843. It tooks ages to startup also moving from one dir to other take really long. Looking forward for solutions…

temperory solution: comment these codes in local function git_prompt_filter() in clink.lua under cmder\vendor folder:

local git_dir = get_git_dir()
    if git_dir then
        -- if we're inside of git repo then try to detect current branch
        local branch = get_git_branch(git_dir)
        local color
        if branch then
            -- Has branch => therefore it is a git folder, now figure out status
            local gitStatus = get_git_status()
            local gitConflict = get_git_conflict()

            color = colors.dirty
            if gitStatus then
                color = colors.clean
            end

            if gitConflict then
                color = colors.conflict
            end 

            clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
            return false
        end
    end

then cmder will not try to get git status in git folder

looks like switching "terminal.integrated.gpuAcceleration": "off" made things way better in my case. big thanks for the help @chrisant996

@aleksandarbos Glad to help

@aleksandarbos I assume you are using git? How big is the git repo? Is the speed consistent across all git repos?

Is this a fresh cmder install or have you updated an old install over the years? Try a fresh install.

@chrisant996 if the below is incorrect, please correct me:

Look in %cmder_root%\config\cmder_prompt_config.lua for the below:

-- OPTIONAL. If true then always ignore the cmder.status and cmder.cmdstatus git config settings and run the git prompt commands in the background. 
  -- default is false 
  -- NOTE: This only takes effect if using Clink v1.2.10 or higher. 
 prompt_overrideGitStatusOptIn = false

Set it to true.

In my case, the slowness was caused by my laptop looking for my employer’s domain when I was at home. It seems to be some kind of windows terribleness where the domain lookup has to timeout before cmder (or maybe the underlying msys?) can run anything.

I found a work-around here: http://bjg.io/guide/cygwin-ad/)

I’m seeing extreme slowness as well.

I read somewhere(Google how to speed up WSL) Windows Defender affects the speeds of WSL very very much. You can get 5x speed on WSL I/O and other operations by disabling it. Maybe disabling it will also help Cmder.