# Git super slow on Windows 7

5 messages from 2015-11-25 to 2015-11-25. Participants: Lars Schneider, Stefan Beller, Duy Nguyen.
Thread: https://gitlist.dev/t/40883

## Lars Schneider, 2015-11-25 12:35

Subject: Git super slow on Windows 7
Message-ID: <EEA07A84-26D8-4709-97AC-2C4F3A0CC5BD@gmail.com>
URL: https://gitlist.dev/e/EEA07A84-26D8-4709-97AC-2C4F3A0CC5BD%40gmail.com

```
Hi Johannes,

I am working with Git for Windows right now and it is dramatically slower than on OS X.
I executed "time git status" on Windows and OS X with the same repository and the following results:

## Windows git version 2.6.3.windows.1 (with enabled experimental flag on install):
real    0m1.327s
user    0m0.000s
sys     0m0.015s


## OS X git version 2.4.9 (Apple Git-60):
git status  0.06s user 0.13s system 102% cpu 0.186 total


Initially it was even slower on Windows (~1.6s). According to [1] I used the following settings to make it faster:
$ git config --global core.preloadindex true
$ git config --global core.fscache true

Is this behavior normal/expected?
If it is not normal, how would you debug the issue? How can I find out why it is so slow?

My user drive is not on a net share and the machine has a SSD.

Thanks,
Lars


[1] http://stackoverflow.com/questions/4485059/git-bash-is-extremely-slow-in-windows-7-x64
```

## Lars Schneider, 2015-11-25 18:42

Subject: Re: Git super slow on Windows 7
Message-ID: <0B47434E-00FE-463A-95F1-1F10537C9F7A@gmail.com>
URL: https://gitlist.dev/e/0B47434E-00FE-463A-95F1-1F10537C9F7A%40gmail.com
In-Reply-To: <EEA07A84-26D8-4709-97AC-2C4F3A0CC5BD@gmail.com>

```
After some investigation I figured that ~50 Submodules are the culprit.
Does anyone have an idea how to speed up Git on Windows while keeping 50 Submodules?

Thanks,
Lars


> On 25 Nov 2015, at 13:35, Lars Schneider <larsxschneider@gmail.com> wrote:
> 
> Hi Johannes,
> 
> I am working with Git for Windows right now and it is dramatically slower than on OS X.
> I executed "time git status" on Windows and OS X with the same repository and the following results:
> 
> ## Windows git version 2.6.3.windows.1 (with enabled experimental flag on install):
> real    0m1.327s
> user    0m0.000s
> sys     0m0.015s
> 
> 
> ## OS X git version 2.4.9 (Apple Git-60):
> git status  0.06s user 0.13s system 102% cpu 0.186 total
> 
> 
> Initially it was even slower on Windows (~1.6s). According to [1] I used the following settings to make it faster:
> $ git config --global core.preloadindex true
> $ git config --global core.fscache true
> 
> Is this behavior normal/expected?
> If it is not normal, how would you debug the issue? How can I find out why it is so slow?
> 
> My user drive is not on a net share and the machine has a SSD.
> 
> Thanks,
> Lars
> 
> 
> [1] http://stackoverflow.com/questions/4485059/git-bash-is-extremely-slow-in-windows-7-x64

```

## Stefan Beller, 2015-11-25 18:47

Subject: Re: Git super slow on Windows 7
Message-ID: <CAGZ79kZQd4JrQsp6sk8x-OAWMxxbF+a8BXZb1VQSdJeiQ8jhuQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kZQd4JrQsp6sk8x-OAWMxxbF%2Ba8BXZb1VQSdJeiQ8jhuQ%40mail.gmail.com
In-Reply-To: <0B47434E-00FE-463A-95F1-1F10537C9F7A@gmail.com>

```
On Wed, Nov 25, 2015 at 10:42 AM, Lars Schneider
<larsxschneider@gmail.com> wrote:
> After some investigation I figured that ~50 Submodules are the culprit.
> Does anyone have an idea how to speed up Git on Windows while keeping 50 Submodules?
>
> Thanks,
> Lars
>
>

Use the latest version of Git ;)

Checkout the series merged at 65e1449
(2015-10-05, Merge branch 'sb/submodule-helper')

    The infrastructure to rewrite "git submodule" in C is being built
    incrementally.  Let's polish these early parts well enough and make
    them graduate to 'next' and 'master', so that the more involved
    follow-up can start cooking on a solid ground.

    * sb/submodule-helper:
      submodule: rewrite `module_clone` shell function in C
      submodule: rewrite `module_name` shell function in C
      submodule: rewrite `module_list` shell function in C

More specifically the commits in there:

submodule: rewrite `module_name` shell function in C

    This implements the helper `name` in C instead of shell,
    yielding a nice performance boost.

    Before this patch, I measured a time (best out of three):

      $ time ./t7400-submodule-basic.sh  >/dev/null
        real 0m11.066s
        user 0m3.348s
        sys 0m8.534s

    With this patch applied I measured (also best out of three)

      $ time ./t7400-submodule-basic.sh  >/dev/null
        real 0m10.063s
        user 0m3.044s
        sys 0m7.487s

```

## Duy Nguyen, 2015-11-25 20:23

Subject: Re: Git super slow on Windows 7
Message-ID: <CACsJy8Becrc57+56BCLSq8Pd9p5m2qpERqXwY2AN21H=BfADNA@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Becrc57%2B56BCLSq8Pd9p5m2qpERqXwY2AN21H%3DBfADNA%40mail.gmail.com
In-Reply-To: <CAGZ79kZQd4JrQsp6sk8x-OAWMxxbF+a8BXZb1VQSdJeiQ8jhuQ@mail.gmail.com>

```
On Wed, Nov 25, 2015 at 7:47 PM, Stefan Beller <sbeller@google.com> wrote:
> On Wed, Nov 25, 2015 at 10:42 AM, Lars Schneider
> <larsxschneider@gmail.com> wrote:
>> After some investigation I figured that ~50 Submodules are the culprit.
>> Does anyone have an idea how to speed up Git on Windows while keeping 50 Submodules?
>>
>> Thanks,
>> Lars
>>
>>
>
> Use the latest version of Git ;)

Does it do parallel refresh yet? I think it would help.  I only looked
at "git log --merges origin/pu" and nothing caught my eyes.
-- 
Duy

```

## Stefan Beller, 2015-11-25 20:42

Subject: Re: Git super slow on Windows 7
Message-ID: <CAGZ79kYUor3Hx+ggaDvkc8MSH+nMtZrgGXRvgLz2qqHZmy5tCg@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kYUor3Hx%2BggaDvkc8MSH%2BnMtZrgGXRvgLz2qqHZmy5tCg%40mail.gmail.com
In-Reply-To: <CACsJy8Becrc57+56BCLSq8Pd9p5m2qpERqXwY2AN21H=BfADNA@mail.gmail.com>

```
On Wed, Nov 25, 2015 at 12:23 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> On Wed, Nov 25, 2015 at 7:47 PM, Stefan Beller <sbeller@google.com> wrote:
>> On Wed, Nov 25, 2015 at 10:42 AM, Lars Schneider
>> <larsxschneider@gmail.com> wrote:
>>> After some investigation I figured that ~50 Submodules are the culprit.
>>> Does anyone have an idea how to speed up Git on Windows while keeping 50 Submodules?
>>>
>>> Thanks,
>>> Lars
>>>
>>>
>>
>> Use the latest version of Git ;)
>
> Does it do parallel refresh yet? I think it would help.  I only looked
> at "git log --merges origin/pu" and nothing caught my eyes.

No. The hinted patch series only does a partial shell->C conversion, which
is the best guess for improving git status here.

I punted on parallel local operations inside "git submodule update" for now, too
as when things go wrong there, you need a human to resolve the merge conflict,
and as a user you only want to deal with one merge conflict at a time instead of
being left there with a ton of unresolved issues (according to the git
log of older
patches in the submodule area).

git status should require not human interaction if things go bad
within submodules,
so we may want to speed that up by parallelizing the submodule part. The status
command gathers all information of submodules by a call to "git
submodule summary"
and does some slight post processing on the output. "git submodule
summary" however
is written completely in shell code (200 lines, so I estimate 400 lines of C).

I will benchmark that later today and check if it's worth for us to
rewrite that in C for
our case (we plan to have lots more submodules, but we're a linux shop)

```
