MinGW and Python

sturlamolden sturlamolden at yahoo.no
Tue Apr 25 13:26:19 EDT 2006


Edward Elliott wrote:

> if so, i do see good reason to build with mingw instead of gcc/cygwin.

MinGW and Cygwin GCC is actually the same compiler. On Cygwin you can
remove the dependency on the cygwin dll by compiling with -mno-cygwin.
But as long as the cygwin dll is there, it creates an overhead for any
system call. The worst overhead is associated with the Unix fork()
system call, which Cygwin must emulate as there are no Win32
equivalent. In particular, a fork() on Unix will be optimized with
copy-on-write semantics in the kernel, but Cygwin cannot emulate that
as it has no access to the Windows kernel.

Another issue is that MinGW and Cygwin implements C++ exceptions with
setjmp/longjmp. Other verions of GCC (including DJGPP for DOS) does not
do this and as a result produces faster code for C++. I don't know if
there are any C++ in Python, but if there is, it will be an issue. it
is not an issue for plain C though.

Finally, MinGW (I am not sure about Cygwin) statically links the C++
standard library. VC++ and GCC on other platforms (e.g. Linux) does not
(normally) do this, and as a result the executables get a smaller
footprint.




More information about the Python-list mailing list