From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,e1b09bdf3cb61da4 X-Google-Attributes: gid111c93,public From: Jeff Sturm Subject: Re: zlib-1.1.3 compiles with ccc Date: 2000/09/16 Message-ID: <39C3F9EE.694F5B7E@appnet.com>#1/1 X-Deja-AN: 670664770 Content-Transfer-Encoding: 7bit References: <39C22EF3.40ABD76C@saunalahti.fi> <8ptr7t$j2u$2@pulp.srv.ualberta.ca> <39C37274.1220852E@saunalahti.fi> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.mi.home.com 969144877 24.7.252.3 (Sat, 16 Sep 2000 15:54:37 PDT) Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Sat, 16 Sep 2000 15:54:37 PDT Newsgroups: comp.os.linux.alpha 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