This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How efficient is the g++ compipler in cygwin?


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 cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]