Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Jeff Sturm <jeff.sturm@appnet.com>
Subject: Re: zlib-1.1.3 compiles with ccc
Date: 2000/09/16	[thread overview]
Message-ID: <39C3F9EE.694F5B7E@appnet.com> (raw)
In-Reply-To: 39C37274.1220852E@saunalahti.fi

h0l0gRaM wrote:
> > What's the benifit of ccc over gcc?
> >
> 15-30 percent faster binary code ,sometimes maybe faster.

And sometimes slower.  It just happens that the first program I bothered
to benchmark with ccc (gcbench) ran slower than with gcc.  Others show
little or no improvement, though executables built with ccc tend to be
somewhat smaller.

I'm curious, have you made any real measurements of gcc vs. ccc?  If so,
what version?  Did you use the Red Hat-supplied egcs or build the latest
release (2.95.2)?  Are you using any architecture features (e.g. BWX,
MVI), or generating plain (ev4) binaries?

GCC has specific weaknesses on Alpha, namely floating-point and the f77
front end.  On integer performance it is quite good, and getting better
(2.95.2 supports alias detection, among other  improvements over egcs).

It's actually good to have a choice of compilers.  That gives us a
baseline for measuring compiler performance, among other things.  If we
find code that seems to run poorly, we have several options:

1) Modify the source.  Optimizers aren't perfect, they can often do much
better with a little help, e.g. declare short routines "inline" and use
temporary variables for common expressions.

2) Try other compiler flags.  Both gcc and ccc have many options, and
full optimization is often not helpful.  On critical pieces of code it
is worthwhile to try several optimization levels and see which give the
best results.

3) Use another compiler.  For C code, it isn't usually necessary to
recompile the entire project.  Find the routines that optimize poorly
and try compiling them with ccc or gcc as the case may be.  Also new
releases of the same compiler will have different code generation
characterstics.  GCC 3, whenever it is released, promises to be a worthy
successor to 2.95, especially for c++ code.

A dogmatic adherence to one compiler or the other won't give you
satisfactory results.  Finding and analyzing performance problems will. 
(Hint: not all problems are compiler related; look in glibc for
example.)  It's not an easy task, but luckily the Alpha has good tools
(ever heard of iprobe?)

Perhaps instead of posting "package xxx compiles with ccc", a more
meaningful post may be "package xxx compiles with ccc and runs yy%
faster on a test case than when compiled with gcc version zzz".

Jeff



  reply	other threads:[~2000-09-16  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-15  4:00 zlib-1.1.3 compiles with ccc h0l0gRaM
2000-09-15  4:00 ` Michal Jaegermann
2000-09-15  4:00   ` Tony Hammitt
2000-09-15 23:45   ` h0l0gRaM
2000-09-16  4:00     ` Michal Jaegermann
2000-09-16  4:00   ` Spuggy Loonpant
2000-09-16  4:00     ` sideband
2000-09-16  4:00       ` h0l0gRaM
2000-09-16  4:00         ` Jeff Sturm [this message]
2000-09-17  0:22           ` h0l0gRaM
2000-09-17  4:00       ` Spuggy Loonpant
2000-09-17  4:00         ` Michal Jaegermann
2000-09-18  3:35         ` Tony Hammitt
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox