Skip to content

git "startup" slow #5920

@kkmuffme

Description

@kkmuffme

Existing issues matching what you're seeing

  • I was not able to find an open or closed issue matching what I'm seeing

Git for Windows version

>time git --version

always takes at least 100ms
(and therefore all git commands have this overhead cost)

Specifying the absolute path (both in Windows as well as in cygwin form) makes no difference.


Compared to e.g.
>time echo "hello" | tail -1

(or any other commands in git bash)
which take <30ms (which is still abysmally slow compared to unix, where it's 3ms)

Even with all trace flags enabled

time GIT_TRACE=1 GIT_TRACE_PERFORMANCE=1 GIT_TRACE_SETUP=1 GIT_TRACE_PACK_ACCESS=1 GIT_TRACE_PACKET=1 GIT_TRACE_PACKFILE=1 GIT_CURL_VERBOSE=1 git config --get user.name
08:24:33.668820 exec-cmd.c:266          trace: resolved executable dir: C:/Progr
am Files/Git/mingw64/bin
08:24:33.674816 trace.c:316             setup: git_dir: .git
08:24:33.674816 trace.c:317             setup: git_common_dir: .git
08:24:33.674816 trace.c:318             setup: worktree: C:/Dev/bitbucket
08:24:33.674816 trace.c:319             setup: cwd: C:/Dev/bitbucket
08:24:33.675818 trace.c:320             setup: prefix: (null)
08:24:33.675818 git.c:476               trace: built-in: git config --get user.n
ame
Foo
08:24:33.676818 trace.c:416             performance: 0.002770800 s: git command:
 'C:\Program Files\Git\mingw64\bin\git.exe' config --get user.name

real    0m0.117s
user    0m0.000s
sys     0m0.016s


we see that the git command itself is super fast, like on unix.
But there is something before (or after?) that causes it to be significantly slower than all other programs in git bash.

When checking ldd it shows only cygwin.
Is this an issue there? Or any suggestions on how to debug this further?

Windows version

Windows 11

Windows CPU architecture

x86_64 (64-bit)

Additional Windows version information

Options set during installation

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: ExternalOpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable FSMonitor: Disabled

Other interesting things

No response

Terminal/shell

git bash

Commands that trigger the issue

all

Expected behaviour

faster startup

Actual behaviour

slow

Repository

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions