1

I was planning to program in c using cygwin on windows. Does this have any performance drawbacks when compared to using gcc in ubuntu?

1
  • 1
    cygwin is huge and in my experience slow. If possible, its better to write your program under linux, and later get it building correctly under cygwin/minsys on windows. Commented Jun 27, 2011 at 3:12

3 Answers 3

4

I've used Cygwin on Windows 7 and Windows 2008 R2 for C development. The experience was painful: not only slow, but I never did manage to get my preferred editor (Emacs) working properly in Cygwin.

You could try a live distro of Linux that you could boot from a USB memory stick. That way you could program in C to your heart's content without having to install any software on your PC. I'd recommend Puppy Linux if you took that approach.

Alternatively, you could install a virtualisation product (like VirtualBox) and create a Linux VM. In that case, I'd suggest using Ubuntu.

My experience is that either the live distro or VM approach would be better than using Cygwin as a development environment.

Sign up to request clarification or add additional context in comments.

Comments

0

You won't get the exact same performance. But whether this is a drawback or not depends on what you are doing.

Comments

0

Few more things to understand:

GCC-Cygwin:

Pros -

  1. Compiling C code using gcc under cygwin would generate a windows executable, which uses the cygwin.dll(Posix emulation layer) linked dynamically into your app/code. So if you need to execute this app from some other path or other windows machine, that should have cygwin installed and in its path else you get error.

  2. Cygwin provides a benefit in that, if you have a POSIX compliant code developed on Linux-gcc you can compile it with no changes at all(very little changes in some case) on windows. So it kind of provides Posix compatibility on windows.

Cons -

  1. If you are going to run some which is going to consume heavy system resources(memory,CPU) then not sure how cygwin would scale up as compared to a native executable on Linux.

  2. Sometimes, Debugging using ddd on cygwin, I have found some weird crashes/hang of the ddd.

GCC-Linux:

  1. If your final app is going to be executing on Linux, it makes sense to compile, and debug it under the same environment. Linux-gcc.

  2. For Debugging , linux would provide you lot of tools (gdb/ddd, valgrind), etc.

  3. If you want to accelerate some critical protion of code, using inline assembly with gcc under linux is nicely defined and has no issues working.(Udner Cygwin, i have faced sometimes that getting a inline assembly compiled was a problem)

  4. If you want to add multiple threads for execution on multiple processors/cores, then pthreads comes to your help(Not sure about the same udner cygwin)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.