1

I got a git repository with several submodules and got horrible performance on my Windows 10 build 15063, while on my Linux Mint 18 Sarah everything is fast as the speed light.

Both on Windows and Linux using the Smartgit client, where I can do checkout on a test branch, but takes like 3 minutes to finish the process on the Windows machine:

Check Out Branch
    D:\SublimeText\Data\Packages> git.exe checkout test
    Switched to branch 'test'
    D:\SublimeText\Data\Packages\Default Syntax> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Force Rewrite Sublime Settings> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Side-by-Side Settings> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Overwrite Commit Completion> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Sublime Text Studio> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\MarkdownLight> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Fixed Selections Clear> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\SublimeCodeIntel> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Open Auto Completion> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\amxmodx> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Shell Script> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Notepad++ Color Scheme> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\LaTeXTools> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\.versioning> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Toolbar> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\BBCode> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Select All Spelling Errors> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Markdown to BB Code Converter> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\All Autocomplete> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Package Control> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\AutoFileName> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\SQL Keyword Uppercase> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Fix Project Switch Restart Bug> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Indent and braces> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Override Unpacked Packages> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\GotoLastEditEnhanced> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\PowerCursors> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\FuzzyFilePath> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Clear Cursors Carets> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\ANSIescape> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Preferences Editor> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\BufferScroll> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\PackageDev> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Clipboard Scope Copy> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\SideBarEnhancements> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\View Settings Freely> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Fix Selection After Indent> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Amxx Pawn> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\SublimeREPL> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\SyncedSideBar> git.exe fetch --progress --prune --recurse-submodules=no origin
    D:\SublimeText\Data\Packages\Active View Jump Back> git.exe fetch --progress --prune --recurse-submodules=no origin

Otherwise on the Linux machine, using the same repository, I can do the checkout on a test branch in something like 5 seconds:

Check Out Branch
    ~/.config/sublime-text-3/Packages> git checkout test_linux
    Switched to branch 'test'

Is it possible to make the git checkout on Windows as fast as the git checkout on Linux?

I found this other question, but I dit not understand if it applies here:

  1. Git is slow on pushing submodules change to origin

Update

After @derHugo commentary, I find out that running git from the command line on windows and typing git checkout test is as fast as on linux.

Now I would have to change the question and ask why the Smartgit client for Windows is doing this slow thing, while the Linux one, doesn't.

How can I disable this slow checkout on the Windows Smartgit client and what will be the consequences?

user
  • 5,816
  • 7
  • 53
  • 105
  • it seems that your smargit client does not only do the checkout but also a recursiv fetch on your repo while git on linux only performs the checkout itself. – derHugo Jun 18 '17 at 16:08
  • Are the hardware and method of accessing the Git repository both identical? – Andrew Henle Jun 18 '17 at 16:08
  • The Linux is a virtual machine is running inside the Windows I did the same tests. So, in theory, the Linux should be a little slower by the virtual environment, but it is much faster. – user Jun 18 '17 at 16:10
  • yes but I guess you don't use smartgit client on linux, do you? Did you try just using the usual [git for windows](https://git-scm.com/download/win) ? – derHugo Jun 18 '17 at 16:15
  • I use on both Windows and Linux the Smartgit client. Thanks @derHugo, I just opened the command line on windows and typed `git checkout test` and it was as fast as on linux. Now I would have to change the question and ask why the Smartgit client for Windows is doing this slow thing, while the Linux one, doesn't. – user Jun 18 '17 at 16:19
  • I still think maybe the windows one performs those fetch lines while the client on linux does not. Might be some automation on the windows client to make sure everything is up-to-date when switching to a new branch – derHugo Jun 18 '17 at 16:22
  • I agree, seems the Windows client is going these extra steps. Now the question is why it is doing it, while the Linux client does not. I installed the Smartgit client for both Windows and Linux the same way, I did not changed any different setting, except the smartgit.core.push.recurseSubmodulesCheck -> push --recurse-submodules=on-demand following https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/smartgit/RpsRjUCmduA/U8Z5nkKvBQAJ – user Jun 18 '17 at 16:28

1 Answers1

3

SmartGit seem to execute a series of git.exe command, each one having to spawn a bash session (spawning/starting a new shell is slow).
See more at "How are msys, msys2, and msysgit related to each other?"

If you do the same in a git bash session, all those commands (for each submodule checkout) can reuse the current shell session: much faster, even on Windows.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283