Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: c compilati...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 18 of 38 Topic 26135 of 26977
Post > Topic >>

Re: c compilation - gcc vs visual c

by kumarchi@[EMAIL PROTECTED] May 9, 2008 at 06:16 PM

On May 9, 6:41=A0pm, "cr88192" <cr88...@[EMAIL PROTECTED]
> wrote:
> <kumar...@[EMAIL PROTECTED]
> wrote in message
>
>
news:4780a4b0-8034-4a20-9058-8d53c89bfdd4@[EMAIL PROTECTED]
>
>
>
> > 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.
>
> likely reason:
> MS focuses a lot more on specific optimizations, and tweaking
performance
> for specific targets;
> gcc, however, targets many targets, and tends to use far more generic
code=

> generation (they try more to leverage fancy general purpose
optimizations,=

> rather than arch-specific tweaks for various special cases).
>
> in any case, gcc tends to, fairly often, produce fairly silly code (even
> with optimizations), and, sadly, even with a very braindead
lower-compiler=

> design (a hacked over stack machine), and optimizations focusing more on
> "common special cases", it is not too hard to match or somewhat exceed
gcc=
's
> performance...
>
> IMO, the 'O' options may well be Obfuscate rather than Optimize...
>
> actually, one of the better ways at optimizing, would be likely to
impleme=
nt
> a kind of abstract combinatorial tester, which would basically search
the
> space of possible optimizations and look for the ones with the lowest
> simulated cost. sadly though, this will not work so well in the face of
> usage patterns, which require actually using the code (the general
option
> could treat a very common case like an uncommon case, ...).
>
> in something like a VM, it could be possible to use a kind of genetic
> evolver for adapting functions (initially, it compiles functions
> generically, and any functions it detects are using a significant
****tion =
of
> the time, it starts mutating in an attempt to improve the general
> performance). later, if/when a "final" version is desired, it uses the
> versions of the functions found to be most effective.
>
> note that this would likely be confined to the realms of low-level
> optimization, with what are typically the biggest time wasters (general
> algorithmic issues), being beyond the scope of such a tool...
>
> the simplest approach, however (and the one I currently use in my
compiler=
),
> is to basically just test the compiler, and any obvious issues in the
outp=
ut
> (silly code), are ones I focus on fixing.
>
> the compiler machinery itself in my case, as this level, is little more
th=
an
> just a very large and elaborate mass of decision trees (no fancy
transform=
s
> or general optimizer machinery, more just operations dispatched through
a
> maze of function calls).
>
> this approach seems to work good enough IME...
>
the  one silver lining in this affair s because my code is simple, it
shoudl be possible for a compiler guru to zero in on the fundamental
issues and fix gcc

msvc cannot have some voodoo magic on a simple code like that

pardon my layman type of understanding!!


> > is anybody else seeing the same thing. if this is true microsoft c
> > compiler is in a different league altogether
>
> that, or, most of us are not that concerned with raw performance (vs
havin=
g
> a compiler we are not obligated to pay for...).
>
> none the less, MS has at least a decent compiler in these regards...
>
> > i was not successful so far compiling under mingw. will it make dent ?
> > 2x is hard to overcome
>
> well, with gcc, it is hard to do much better...
>
> as noted, MSVC and Intel are good options...
 




 38 Posts in Topic:
c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 12:20:19 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-09 22:20:09 
Re: c compilation - gcc vs visual c
Ulrich Eckhardt <dooms  2008-05-09 22:32:07 
Re: c compilation - gcc vs visual c
"Chris Thomasson&quo  2008-05-30 16:59:33 
Re: c compilation - gcc vs visual c
micans@[EMAIL PROTECTED]   2008-05-09 13:38:04 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 14:03:14 
Re: c compilation - gcc vs visual c
Ian Collins <ian-news@  2008-05-10 09:22:41 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-09 23:50:30 
Re: c compilation - gcc vs visual c
Niz <notarealemailaddr  2008-05-09 23:08:26 
Re: c compilation - gcc vs visual c
"cr88192" <c  2008-05-10 15:28:50 
Re: c compilation - gcc vs visual c
"Sean G. McLaughlin&  2008-05-10 17:30:35 
Re: c compilation - gcc vs visual c
moi <root@[EMAIL PROTE  2008-05-09 23:21:36 
Re: c compilation - gcc vs visual c
Antoninus Twink <nospa  2008-05-10 00:13:19 
Re: c compilation - gcc vs visual c
"cr88192" <c  2008-05-10 08:41:39 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 17:59:22 
Re: c compilation - gcc vs visual c
Willem <willem@[EMAIL   2008-05-10 06:20:09 
Re: c compilation - gcc vs visual c
William Ahern <william  2008-05-10 16:23:36 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-09 18:16:26 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 13:32:58 
Re: c compilation - gcc vs visual c
roberson@[EMAIL PROTECTED  2008-05-10 12:49:26 
Re: c compilation - gcc vs visual c
jacob navia <jacob@[EM  2008-05-10 17:41:23 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 09:49:58 
Re: c compilation - gcc vs visual c
"Sean G. McLaughlin&  2008-05-10 17:29:06 
Re: c compilation - gcc vs visual c
moi <root@[EMAIL PROTE  2008-05-10 19:18:18 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 18:58:15 
Re: c compilation - gcc vs visual c
Chris H <chris@[EMAIL   2008-05-10 19:00:47 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 12:13:38 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-10 12:29:47 
Re: c compilation - gcc vs visual c
Rui Maciel <rui.maciel  2008-05-10 20:20:13 
Re: c compilation - gcc vs visual c
Barry Schwarz <schwarz  2008-05-16 19:12:48 
Re: c compilation - gcc vs visual c
Peter Nilsson <airia@[  2008-05-16 20:17:14 
[OT] Re: c compilation - gcc vs visual c
Tim Prince <tprince@[E  2008-05-16 23:30:55 
Re: c compilation - gcc vs visual c
Walter Banks <walter@[  2008-05-17 05:29:18 
Re: c compilation - gcc vs visual c
CBFalconer <cbfalconer  2008-05-17 06:59:53 
Re: c compilation - gcc vs visual c
Ben Bacarisse <ben.use  2008-05-18 14:00:22 
Re: c compilation - gcc vs visual c
kumarchi@[EMAIL PROTECTED  2008-05-30 09:09:43 
Re: c compilation - gcc vs visual c
Antoninus Twink <nospa  2008-05-30 19:34:08 
Re: c compilation - gcc vs visual c
"robertwessel2@[EMAI  2008-05-30 17:12:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:48:54 CDT 2008.