Why is cygwin so slow

I run a script on Ubuntu and tested my time:

$ time ./merger ./merger 0.02s user 0.03s system 99% cpu 0.050 total 

he spent less than 1 second. but if I used cygwin:

 $ time ./merger real 3m22.407s user 0m0.367s sys 0m0.354s 

More than 3 minutes have passed. Why did this happen? What should I do to increase execution speed on cygwin?

+7
source share
1 answer

As already mentioned, the Cygwin implementation for plugging and popping up a process on Windows is generally slow.

Using this fork () metric , I get the following results:

 rr-@cygwin :~$ ./test 1000 Forked, executed and destroyed 1000 processes in 5.660011 seconds. rr-@arch :~$ ./test 1000 Forked, executed and destroyed 1000 processes in 0.142595 seconds. rr-@debian :~$ ./test 1000 Forked, executed and destroyed 1000 processes in 1.141982 seconds. 

Using time (for i in {1..10000};do cat /dev/null;done) to compare the performance of the spawning process, I get the following results:

 rr-@work :~$ time (for i in {1..10000};do cat /dev/null;done) (...) 19.11s user 38.13s system 87% cpu 1:05.48 total rr-@arch :~$ time (for i in {1..10000};do cat /dev/null;done) (...) 0.06s user 0.56s system 18% cpu 3.407 total rr-@debian :~$ time (for i in {1..10000};do cat /dev/null;done) (...) 0.51s user 4.98s system 21% cpu 25.354 total 

Technical characteristics of the equipment:

  • cygwin : Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
  • Arch : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  • debian : Intel(R) Core(TM)2 Duo CPU T5270 @ 1.40GHz

So, as you can see, no matter what you use, Cygwin will always work worse. In this test, he loses his hands even on the worst equipment ( cygwin vs. debian , according to this comparison ).

+1
source

All Articles