From: Dave Steffen <steffend@glitch.physics.colostate.edu>
To: egcs@cygnus.com
Subject: EGCS vs GCC performance
Date: Mon, 12 Jan 1998 20:31:00 -0000 [thread overview]
Message-ID: <199801130145.RAA07615@cygnus.com> (raw)
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
next reply other threads:[~1998-01-12 20:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-01-12 20:31 Dave Steffen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199801130145.RAA07615@cygnus.com \
--to=steffend@glitch.physics.colostate.edu \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).