PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > c compilation - gcc vs visual c
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
c compilation - gcc vs visual c

Réponse
 
LinkBack Outils de la discussion
Vieux 09/05/2008, 20h20   #1
kumarchi@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut c compilation - gcc vs visual c

hello:

I recently compiled a numerically intensive c project under cygwin gcc
3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
dual core lap top.

the numerical stuff is both floating point and integer intensive

The gcc optimized (-O3) vs non optimized improved the performance 30 %

visual c optimized (standard , check 'release; under visual c 2005)
vs non optimized ('build') was a whopping 8x performance gain

but the most surprising thing was visual c optimized was 2x
performance over gcc optimized.

is anybody else seeing the same thing. if this is true microsoft c
compiler is in a different league altogether

i was not successful so far compiling under mingw. will it make dent ?
2x is hard to overcome
  Réponse avec citation
Vieux 09/05/2008, 21h20   #2
jacob navia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

kumarchi@gmail.com wrote:
> hello:
>
> I recently compiled a numerically intensive c project under cygwin gcc
> 3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
> dual core lap top.
>
> the numerical stuff is both floating point and integer intensive
>
> The gcc optimized (-O3) vs non optimized improved the performance 30 %
>


The more you go with higher optimizations, the slower
it goes. Use -O2.


> visual c optimized (standard , check 'release; under visual c 2005)
> vs non optimized ('build') was a whopping 8x performance gain
>


This is because the non optimized version injects a lot of
checking code to avoid bugs. It is slower than strictly necessary.
For instance they check at function exit if there wasn't a stack overwrite.


> but the most surprising thing was visual c optimized was 2x
> performance over gcc optimized.
>


Intel compiler is even better than Microsoft. It is the best compiler
for the intel architecture. Period.

> is anybody else seeing the same thing. if this is true microsoft c
> compiler is in a different league altogether
>


Obviously Microsoft leaves gcc far behind, and I have been seeing this
since at least 8-9 years.

> i was not successful so far compiling under mingw. will it make dent ?
> 2x is hard to overcome



mingw is just gcc using Microsoft run time library. Do not expect
anything better/worst.

It is not surprising that gcc is slower than Microsoft since the
people behind each project have vastly different objectives and
budgets to implement them.

Gcc is running in many platforms and architectures.
Microsoft is running in one platform exclusively.

Gcc implements standards like C99 (module small problems), Microsoft
implements only Microsoft environments (.net, etc). Microsoft is
still at C89 level.





--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
  Réponse avec citation
Vieux 09/05/2008, 21h32   #3
Ulrich Eckhardt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

jacob navia wrote:
> Microsoft is running in one platform exclusively.


Sorry, but that's untrue. The platforms I know are IA32, Intel's and AMD's
64 bit platforms, MIPS, ARM, SH and maybe some more. Note that the latter
are used for MS' embedded platform.

Uli

  Réponse avec citation
Vieux 09/05/2008, 21h38   #4
micans@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c


kumar...@gmail.com wrote:
> hello:
>
> I recently compiled a numerically intensive c project under cygwin gcc
> 3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
> dual core lap top.
>
> the numerical stuff is both floating point and integer intensive
>
> The gcc optimized (-O3) vs non optimized improved the performance 30 %


It's probably not going to you, but as a point of interest I have
sometimes found -Os
to work better (optimize for size) with gcc.

Stijn


  Réponse avec citation
Vieux 09/05/2008, 22h03   #5
kumarchi@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

On May 9, 4:20pm, jacob navia <ja...@nospam.com> wrote:
> kumar...@gmail.com wrote:
> > hello:

>
> > I recently compiled a numerically intensive c project under cygwin gcc
> > 3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
> > dual core lap top.

>
> > the numerical stuff is both floating point and integer intensive

>
> > The gcc optimized (-O3) vs non optimized improved the performance 30 %

>
> The more you go with higher optimizations, the slower
> it goes. Use -O2.
>
> > visual c optimized (standard , check 'release; under visual c 2005)
> > vs non optimized ('build') was a whopping 8x performance gain

>
> This is because the non optimized version injects a lot of
> checking code to avoid bugs. It is slower than strictly necessary.
> For instance they check at function exit if there wasn't a stack overwrite..
>
> > but the most surprising thing was visual c optimized was 2x
> > performance over gcc optimized.

>
> Intel compiler is even better than Microsoft. It is the best compiler
> for the intel architecture. Period.
>
> > is anybody else seeing the same thing. if this is true microsoft c
> > compiler is in a different league altogether

>
> Obviously Microsoft leaves gcc far behind, and I have been seeing this
> since at least 8-9 years.
>
> > i was not successful so far compiling under mingw. will it make dent ?
> > 2x is hard to overcome

>
> mingw is just gcc using Microsoft run time library. Do not expect
> anything better/worst.
>
> It is not surprising that gcc is slower than Microsoft since the
> people behind each project have vastly different objectives and
> budgets to implement them.
>
> Gcc is running in many platforms and architectures.
> Microsoft is running in one platform exclusively.
>
> Gcc implements standards like C99 (module small problems), Microsoft
> implements only Microsoft environments (.net, etc). Microsoft is
> still at C89 level.
>
> --
> jacob navia
> jacob at jacob point remcomp point fr
> logiciels/informatiquehttp://www.cs.virginia.edu/~lcc-win32


the problem is in my type of product i have to recommend windows
platform because based on gcc performance an apple to apple linux
platform will run 2x slower
  Réponse avec citation
Vieux 09/05/2008, 22h21   #6
moi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

On Fri, 09 May 2008 14:03:14 -0700, kumarchi wrote:

> On May 9, 4:20Âpm, jacob navia <ja...@nospam.com> wrote:
>> kumar...@gmail.com wrote:
>> > hello:

>>
>> > I recently compiled a numerically intensive c project under cygwin
>> > gcc 3.4.4 and microsoft visual c. The platform is intel T2400 1.83
>> > ghz dual core lap top.

>>
>> > the numerical stuff is both floating point and integer intensive

>>
>> > The gcc optimized (-O3) vs non optimized improved the performance 30
>> > %

>>
>> The more you go with higher optimizations, the slower it goes. Use -O2.
>>
>> > visual c optimized (standard , check 'release; under visual c 2005)
>> > vs non optimized ('build') was a whopping 8x performance gain

>>
>> This is because the non optimized version injects a lot of checking
>> code to avoid bugs. It is slower than strictly necessary. For instance
>> they check at function exit if there wasn't a stack overwrite.
>>
>> > but the most surprising thing was visual c optimized was 2x
>> > performance over gcc optimized.


>> Obviously Microsoft leaves gcc far behind, and I have been seeing this
>> since at least 8-9 years.
>>
>> > i was not successful so far compiling under mingw. will it make dent
>> > ? 2x is hard to overcome

>>


> the problem is in my type of product i have to recommend windows
> platform because based on gcc performance an apple to apple linux
> platform will run 2x slower


Did you enable the -march=cpu-type -msse[2] code generation option ?

HTH,
AvK
  Réponse avec citation
Vieux 09/05/2008, 22h22   #7
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

kumarchi@gmail.com wrote:
>
> the problem is in my type of product i have to recommend windows
> platform because based on gcc performance an apple to apple linux
> platform will run 2x slower


Then try the Intel compiler, which is also cross platform.

--
Ian Collins.
  Réponse avec citation
Vieux 09/05/2008, 22h50   #8
jacob navia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: c compilation - gcc vs visual c

kumarchi@gmail.com wrote:
>
> the problem is in my type of product i have to recommend windows
> platform because based on gcc performance an apple to apple linux
> platform will run 2x slower


You can use Intel compiler under linux. Your code will be
faster than under windows/MSVC.

Of course do not tell your customers about Intel/Windows.
:-)


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h34.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14728 seconds with 16 queries