Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any performance issue between Cygwin's GCC over MSVC compiler on Windows? [closed]

Most people use gcc on Linux and MSVC compiler on Windows. I have recently installed Cygwin's GCC compiler on my Windows machine and am using that.

I am just curios if there is any performance difference between them? I mean GCC cannot be directly installed on Windows so the Cygwin package makes some Linux-like environment on Windows and then GCC is going to use that. So is there any draw back of that?

GCC on Linux and GCC with Cygwin on Windows both have any performance difference?

like image 930
Jeegar Patel Avatar asked Oct 10 '22 10:10

Jeegar Patel


1 Answers

i am just curios that is there any perfomance difference between them?

Sure, there are points where compilers compete:

  1. Compile speed
  2. Memory usage
  3. Generated code efficiency
  4. etc.

In my experience, the first 3 points go to MSVC. GCC on Windows (especially Cygwin distribution) is damn slow in compile speed, but I guess this is expected. GCC is cross-platform, has about 5 middle phases (transforming from one tree to another), has pluggable architecture, and many other things that could sacrifice compile speed for flexibility. I don't have enough data for MSVC architecture. Memory usage is not very significant but still MSVC does better job, I don't really have arguments why it happens, just looking at task manager values. Generated code efficiency is quite a fight. In many cases MSVC wins, but in some other GCC wins. Both are old compilers and have been improved with a LOT of optimizations. One big thing that GCC loses against MSVC is WPO (Whole Program Optimization). MSVC already has it mature for quite a long time, while AFAIK GCC is still moving toward maturity (4.X series is getting better and better, but is not yet comparable to MSVC one).

... cygwin package makes some linux like environment on windows and then gcc is going to use that so is there any draw back of that?

Actually, not really. You can use GCC without any Unix emulation environment. MinGW distribution can be used standalone without MSYS. It's still required however, if you want to compile programs with GNU style in mind (e.g. "./configure && make && make install" style).

gcc on linux and gcc with cygwin on windows both have any perfomance difference ?

Yes. GCC seems to run a lot faster on Linux than Windows, but it's not always GCC itself to blame. Process creation on Windows is a lot more complicated than on Linux (you can compare CreateProcess from WinAPI and exec from Unix) and in general it causes slower execution on Windows than Linux for ANY programs.

like image 161
LeleDumbo Avatar answered Oct 13 '22 11:10

LeleDumbo