Subject: Re: How efficient is the g++ compipler in cygwin?
From: Brendan Simon <[email-masked]>
Cc: [email-masked]
Date: Mon, 23 Aug 1999 09:45:20 +1000

Nuno Bandeira wrote:

>   Hi Leo,
>
> Leo Jingyu LEE wrote:
> > I have compiled the same program using both VC++ 6.0 (release version)
> > and g++ in cygwin, and found that the g++ version takes about three
> > times as much time as the VC++ version to run.  The program is basically
> > computionally intensive with some file reading/writing.  Any commments
> > on this?
>
>   I have the same problem but it looks to me that it is a more general
> efficiency problem. How fast is your cygwin on other operations, like listing
> a folder with a lot of files (ls -l /windows, for example) ? For me its also
> a lot slower than running dir c:\windows in command.com.
>   And lets not mention executing bash scripts...
>   Anyway, if I have to choose, I'll still go for cygwin.

The GNU Compiler Collection is as efficient on Win32 platforms as any other
platforms (eg. Unix) in terms of the code it generates.  You must give it
appropriate optimization command line switches for the best performance.

It is important to note that Cygwin and Mingw both use newlib as the C library
which is well known for its sluggish math routines when compared to glibc.

I think you will find the cygwin environment the reason for your performance
problems.  It is quite slow at invoking other executables which gcc does a lot
of.  I'm not sure if file creation is slow either.  You can try the --pipe
option.  This might improve the compilation speed but not the executable speed.
You can compiling for the Mingw environment (it uses the naitve microsoft
libraries and not the cygwin libraries) by using the --no-cygwin switch.  Mingw
is considerably faster that cygwin but it lacks the posix compatibility that
cygwin gives you.

Brendan Simon.

--
Want to unsubscribe from this list?
Send a message to [email-masked]