This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: slow execution speed when compared against visual c++
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: Marco Satyro <marco at virtualmaterials dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 04 Jan 2003 07:28:05 -0800
- Subject: Re: slow execution speed when compared against visual c++
- References: <3E16827A.30309@virtualmaterials.com>
Marco Satyro <marco@virtualmaterials.com> writes:
> Dear GCC Help
>
> I am considering converting a very large project from Visual C++ to GCC.
> This project does lots of scientific computations and therefore the
> execution speed is very important. I am doing the development on a
> Pentium 4 running Windows XP, and I wrote a little program to test the
> execution speed. I installed gcc using cygwin and wrote the program
> using the bloodshed IDE. The program and makefile are attached
>
> I set the optimization flag to -O3, but I am getting an execution
> speed 480 times slower than when I use Visual C++. It seems like gcc
> is using some kind of floating point emulation instead of using the
> actual hardware math.
>
> Could you provide me with any clues about this problem?
[snip]
http://www.coyotegulch.com/reviews/almabench.html
has some more realistic benchmarks that show a very different picture. It
doesn't favor gcc, but does show that code generated by gcc is
only fractionally than code generated by Intel's compiler.
I don't know what gcc port you are using, but due to cygwin's
unix emulation (not floating point emu) layer, library calls
(especially i/o) are sometimes extradinarily slow under cygwin. If
you are using cygwin gcc, try moving the print statement outside
of the timed section. You may be surprised by the difference. Note
that the goal of cygwin is *not* performance - it is intended to
make it unix applictaions build and run under windows.
On the whole, if you are going to use gcc, you will get much better
performance under linux than under windows.