public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "S. Bosscher" <S.Bosscher@student.tudelft.nl>
To: 'Jeremy Sanders ' <jss@ast.cam.ac.uk>,
	"'gcc@gcc.gnu.org '" <gcc@gcc.gnu.org>
Subject: RE: benchmarking (or almabench)
Date: Tue, 22 Apr 2003 15:38:00 -0000	[thread overview]
Message-ID: <4195D82C2DB1D211B9910008C7C9B06F01F37327@lr0nt3.lr.tudelft.nl> (raw)

-march=pentium4 is known to pessimise code compared to -march=i686 for some
benchmarks, see PR 8474.  Maybe you're seeing the same problem?

Greetz
Steven


-----Original Message-----
From: Jeremy Sanders
To: gcc@gcc.gnu.org
Sent: 22-4-03 16:43
Subject: benchmarking (or almabench)

I've been looking at compiling the almabench benchmark again with gcc.
See:

http://gcc.gnu.org/ml/gcc/2003-01/msg00037.html

With a pentium4 processor I'm getting drastically different times for
the
running the code output from icc and gcc. icc produces code which is up
to
2.7 times faster than gcc code for this program.

(with gcc mainline)

/data/jss/gcc-3.3/bin/g++ -o almabench.o -O2 -mfpmath=sse -msse -msse2
-march=pentium4 -finline-limit=10000 -c almabench.cpp
/data/jss/gcc-3.3/bin/g++ -o almabench -O2 -mfpmath=sse -msse -msse2
-march=pentium4 -finline-limit=10000 almabench.o
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
31.121u 0.060s 0:33.31 93.6%	0+0k 0+0io 212pf+0w
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
31.148u 0.052s 0:33.61 92.7%	0+0k 0+0io 212pf+0w

(I've also tried without sse and march, and there's little difference.
I've also tried fprofile-arcs, which doesn't do anything. inline-limit
has no real effect).

With icc 7.1.

xpc5:/<3>almabench-1.0.1/cpp> make
icc -o almabench.o -O2 -c almabench.cpp
icc -o almabench -O2 almabench.o
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
16.494u 0.013s 0:17.71 93.1%	0+0k 0+0io 116pf+0w
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
16.445u 0.029s 0:17.53 93.8%	0+0k 0+0io 116pf+0w

That's 88% faster than gcc.


Enabling P4 optimisation (okay gcc can't do vectorization):

xpc5:/<3>almabench-1.0.1/cpp> make
icc -o almabench.o -O2 -tpp7 -xW -march=pentium4 -c almabench.cpp
almabench.cpp(219) : (col. 5) remark: LOOP WAS VECTORIZED.
almabench.cpp(230) : (col. 5) remark: LOOP WAS VECTORIZED.
icc -o almabench -O2 -tpp7 -xW -march=pentium4 almabench.o
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
11.318u 0.005s 0:12.09 93.5%	0+0k 0+0io 116pf+0w
xpc5:/<3>almabench-1.0.1/cpp> time ./almabench
11.277u 0.007s 0:12.08 93.2%	0+0k 0+0io 116pf+0w

That's 2.75 times faster than gcc's code.


Obviously this benchmark is synthetic, but it suggests gcc isn't
optimising something in this code very well. We've also seen similar
effects with other floating-point intensive code. Any suggestions? I can
supply assembler output for both if anyone would like a look!

Jeremy

-- 
Jeremy Sanders <jss@ast.cam.ac.uk>   http://www-xray.ast.cam.ac.uk/~jss/
X-Ray Group, Institute of Astronomy, University of Cambridge, UK.
Public Key Server PGP Key ID: E1AAE053

             reply	other threads:[~2003-04-22 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 15:38 S. Bosscher [this message]
2003-04-22 16:00 ` Daniel Berlin
2003-04-22 16:11   ` Jeremy Sanders
2003-04-22 16:09 ` Jeremy Sanders
  -- strict thread matches above, loose matches on Subject: below --
2003-04-22 15:36 Jeremy Sanders

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=4195D82C2DB1D211B9910008C7C9B06F01F37327@lr0nt3.lr.tudelft.nl \
    --to=s.bosscher@student.tudelft.nl \
    --cc=gcc@gcc.gnu.org \
    --cc=jss@ast.cam.ac.uk \
    /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).