public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* EGCS vs GCC performance
@ 1998-01-12 20:31 Dave Steffen
  1998-01-14  4:17 ` jbuck
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Steffen @ 1998-01-12 20:31 UTC (permalink / raw)
  To: egcs

Hi Folks,

   If anybody's interested, I just did a (very) informal performance
   test between EGCS 1.0.1 and GCC 2.7.2. The test involved compiling
   and executing some heavily-templated numerical code on a HP 715
   running HP-UX 9.05.

   The code in both cases was the same, although some of the library
   material was different; I had to hack a few things to work with
   EGCS (or, more accurately, _un-hack_ some gcc things... i.e. I had
   to update some syntax to reflect the standard).

   The result, in a nutshell, is that EGCS outperforms GCC
   significantly in both compile-time and run-time. The downside is
   that the executable is bigger - but for numerical work that's
   rarely important.

	____________________ COMPILATION ____________________

I executed "time make" using GCC: 

g++ -ansi -frepo -O3 -I/usr/local/lib/TNT -I/usr/local/lib/C++  -c kubo.C

    (... etc etc)

real    5m40.990s
user    4m54.180s
sys     0m30.970s

	A lot of time was used recompiling the source to get the
	templates right; this took seven iterations. (The -frepo flag
	is convenient, but it does take a while the first time.

	If all the .rpo files already exist, it's much much faster:

real    1m48.070s
user    1m29.930s
sys     0m9.020s

	
The same build process with EGCS:

real    1m47.720s
user    1m35.070s
sys     0m8.440s

	Which is identical to gcc with the template repository already
	built. OTOH this is a build "from scratch", so this still
	represents a significant improvement for template-heavy code
	(which mine is). Using one of the "manual" template mechanisms
	with gcc would probably match this, but then there's the extra
	programmer time involved... ;-)



      ____________________ EXECUTABLE SIZE ____________________


-rwxr-xr-x   1 steffend users    1107024 Jan 12 16:07 kubo* (gcc)
-rwxr-xr-x   1 steffend users    1572944 Jan 12 16:12 kubo* (egcs)

	     This is irrelevant for my work, but I thought it was
	     interesting.

       ____________________ EXECUTION TIME ____________________

       Roughly speaking, the code diagonalizes a 20x20 matrix of
       complex<double>s by calling fortran routines out of the LAPACK
       library. Obviously this time will be identical for both
       compilers. Then there's a _whole lot_ of matrix and vector
       multiplication as we fold, spindle, and mutilate the
       eigenvectors; this is mostly C++ code (with some more LAPACK
       calls here and there).

       I ran twice with each executable:

GCC:

real    9m8.840s	real    9m13.590s
user    9m5.760s	user    9m10.060s
sys     0m1.540s	sys     0m1.550s

EGCS:

real    6m17.120s	real    7m0.460s
user    5m23.060s	user    6m55.750s
sys     0m33.760	sys     0m1.550s


	This made me very happy; a 20-30% decrease in runtime is
	significant, as most of my runs take a day or two. This will
	also be a big help in convincing my advisor (an unrepentant
	fortran programmer) that C++ is a good language for numerical
	work! ;-)


  This is obviously not an exhaustive test. Will your mileage vary? Of
  course. But it's a good indication that, even aside from language
  standard issues, EGCS is a better compiler than GCC.

  Thanks, guys!

--------------------------------------------------------------------------
Dave Steffen                      Wave after wave will flow with the tide
Dept. of Physics                    And bury the world as it does
Colorado State University         Tide after tide will flow and recede
steffend@lamar.colostate.edu        Leaving life to go on as it was...
							- Peart / RUSH
"The reason that our people suffer in this way.... 
is that our ancestors failed to rule wisely".   -General Choi, Hong Hi







^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1998-01-20 14:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-12 20:31 EGCS vs GCC performance Dave Steffen
1998-01-14  4:17 ` jbuck
1998-01-15 16:06   ` David Edelsohn
1998-01-15 16:30   ` Jeffrey A Law
1998-01-17 23:02     ` Marc Lehmann
1998-01-18 21:51     ` Harvey J. Stein
1998-01-18  0:13       ` Jeffrey A Law
1998-01-19 10:12       ` Richard Henderson
1998-01-20  2:21         ` Harvey J. Stein
1998-01-20 10:07           ` Richard Henderson
1998-01-20 14:54           ` Toon Moene
1998-01-20 14:54             ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).