0

I have spent an inordinate time trying to figure out this conundrum. I have already ruled out the usual suspects when it comes to Cygwin slowness. I have two different installations of Cygwin with wildly different performances. This is quantified below as 'fork performance' as well as time to do a git difftool operation.

Can someone please suggest what I should look at next? The fast cygwin installation is very usable, but I need some up-to-date packages now and any attempts to install, for example, python 3.x results in the whole installation being upgraded (and consequently slowed down :( ).

Summary of performance difference

+---------------------------+----------------+-----------------+----------------------+
|           Desc            | Version1(Fast) | Version2(Slow)  | Git Bash for Windows |
+---------------------------+----------------+-----------------+----------------------+
| git difftool (System CPU) | 15%            | 69%             |                      |
| git difftool (Total Time) | 3.284s         | 10.549s         | 0.46s                |
| fork performance          | ~15            | ~10             | ~22 (!!)             |
+---------------------------+----------------+-----------------+----------------------+

Description of Cygwin installations being compared

Version 1 (referred to as 'V1' below): This is the Babun Cygwin v 1.2.0 (latest stable version). Note that babun itself has been abandoned so this version of Cygwin (64 bit) is quite dated.

Version 2 (referred to as 'V2' below): This has been a number of different things:

  1. V1 upgraded to the latest using cygwin setup.exe
  2. A fresh install of Babun v 1.2.0 (yes, same as V1 !!)
  3. A fresh install of cygwin 64-bit
  4. A fresh install of Babun nightly (from http://40.114.204.90, I don't have the fork of Babun handy from which this is created)

Usual suspects ruled out

The problem is Version1 is at least 3 times faster for a git operation and has almost 50% faster fork performance than Version2 on the same machine. I have looked at 'Slow Cygwin' posts on SO and elsewhere, literally anything that I could find. This includes:

  1. Ruled out any BLODA software (have looked at the BLODA list and also tried opening cygwin with CYGWIN=detect_bloda which does not reveal any surprises. Very early on this revealed ConEmuHK injection as a problem, which I have since disabled to no avail. Additionally to rule out anything similar all of the following tests were done using the core shell executable (zsh.exe) or using mintty.exe without any wrappers on top like Conemu.
  2. Used strace to compare the DLLs being loaded by V1 and V2. Obviously, the cygwin specific DLLs are different, but the list of non-Cygwin DLLs is identical.
  3. I have also tried copying the Cygwin DLLs, in chunks, from V1 (fast) -> V2 (slow), doing a rebaseall after each copy operation.
  4. I have also tried to find out if there is something specific that Babun does while creating the portable Cygwin installation
  5. My PATH is minimal. Nothing on path that's a network share

    /usr/local/bin
    /usr/local/sbin
    /usr/bin
    /cygdrive/c/WINDOWS/system32
    /cygdrive/c/WINDOWS
    /cygdrive/c/WINDOWS/System32/Wbem```
    
  6. Ruled out LDAP issues by creating static /etc/passwd and /etc/group and configured /etc/nsswitch.conf like so:
    enter image description here


Detailed Performance stats

Details of performance difference follow.

Version 1 - Performance

? babun --version
babun version 1.2.0
Created and maintained by Tom Bujok (@tombujok)
Copyright (c) 2014-2015.

~
? while (true); do date --utc; done | uniq -c
 11 Tue, Apr 16, 2019  8:16:43 AM
 13 Tue, Apr 16, 2019  8:16:44 AM
 13 Tue, Apr 16, 2019  8:16:45 AM
 14 Tue, Apr 16, 2019  8:16:46 AM
 14 Tue, Apr 16, 2019  8:16:47 AM
 15 Tue, Apr 16, 2019  8:16:48 AM
 14 Tue, Apr 16, 2019  8:16:49 AM
 13 Tue, Apr 16, 2019  8:16:50 AM
 14 Tue, Apr 16, 2019  8:16:51 AM
 13 Tue, Apr 16, 2019  8:16:52 AM
 13 Tue, Apr 16, 2019  8:16:53 AM
 12 Tue, Apr 16, 2019  8:16:54 AM
 14 Tue, Apr 16, 2019  8:16:55 AM
 13 Tue, Apr 16, 2019  8:16:56 AM
 14 Tue, Apr 16, 2019  8:16:57 AM

❯ time git -C ~/some-git-repo difftool "HEAD~^\!"
0.10s user 0.40s system 15% cpu 3.284 total

Version 2 - Performance

Latest Cygwin 64 bit as of this post

❯ time git -C ~/some-git-repo difftool "HEAD~^\!"
0.14s user 7.17s system 69% cpu 10.549 total

? while (true); do date --utc; done | uniq -c
      4 Tue, Apr 16, 2019  8:21:25 AM
     10 Tue, Apr 16, 2019  8:21:26 AM
      9 Tue, Apr 16, 2019  8:21:27 AM
     10 Tue, Apr 16, 2019  8:21:28 AM
     10 Tue, Apr 16, 2019  8:21:29 AM
     10 Tue, Apr 16, 2019  8:21:30 AM
     10 Tue, Apr 16, 2019  8:21:31 AM
     10 Tue, Apr 16, 2019  8:21:32 AM
     10 Tue, Apr 16, 2019  8:21:33 AM
     10 Tue, Apr 16, 2019  8:21:34 AM
      9 Tue, Apr 16, 2019  8:21:35 AM
     10 Tue, Apr 16, 2019  8:21:36 AM

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
  • I think I would try a clean install of the latest Cygwin, without any babun stuff to see how it performs. – SeeJayBee Apr 17 '19 at 01:41
  • Thank you for the suggestion @ChrisJ.Breisch , I can appreciate that due to the amount of content in my question, it may not have been obvious, but I have already tried that (one of the four under 'Version 2'). Unless you meant that multiple cygwin versions might be conflicting? I have confirmed that they don't by looking at the strace outputs to confirm that the cygwin DLLs being loaded are the expected ones. – Ashutosh Jindal Apr 17 '19 at 08:34
  • Oh, I misunderstood completely. I thought when you said you'd done those four things that you'd done them all one on top of each other. I should learn to read better. – SeeJayBee Apr 17 '19 at 16:37
  • I assume these are on the same drive? So it's not drive performance that's the problem? I thought Babun was 32-bit. Have you compared with a 32-bit Cygwin? No, wait..you've been swapping out DLL's. That wouldn't work unless they were both either 32-bit or 64-bit. Never mind. – SeeJayBee Apr 20 '19 at 03:07

0 Answers0