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++
LLeweLLyn Reese <llewelly@lifesupport.shutdown.com> writes:
> Oscar Fuentes <ofv@wanadoo.es> writes:
>
> F> LLeweLLyn Reese <llewelly@lifesupport.shutdown.com> writes:
> >
> > [snip]
> >
> > > On the whole, if you are going to use gcc, you will get much better
> > > performance under linux than under windows.
> >
> > Are you saying that gcc produces better code on Linux than on
> > Windows?
>
> I was thinking of library issues, not code generation.
Library issues are beyond the scope of gcc. However, I can't see why
Linux should be significantly faster than Windows. If you are
comparing Linux vs Cygwin, well, you will notice a difference on some
areas, yes. Linux and Windows are different beasts. It's normal to see
differences. Sometimes Linux wins, sometimes not. Most of the time the
performance is almost the same. On top of the OS you have the C
library, which affects performance too. On Windows there are several C
libraries available.
> > I thought is the same.
>
> For many cases, yes. But if you are using exceptions, gcc will
> generate *much* better code on linux.
There are two conditionals here, the first being the kind of
exceptions you enable: MinGW can be configured with dwarf exception
handling (at least for C++). As there are some pending issues with
support for throwing exceptions across Windows callbacks, the latest
MinGW release switched back to sjlj exceptions. The other conditional
is what you exactly mean with "*much* better". If you have actual
numbers, please post them, along with the test cases. On my
experience, sjlj exceptions causes a performance penalty that hardly
exceeds 10% over dwarf2. This is not a dramatical difference for me,
but YMMV.
--
Oscar