Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Comapq C++ optimizer weakness
@ 2001-05-29 21:30 Stas
  2001-05-30  7:47 ` Tobias Ernst
  2001-05-31 21:53 ` Compaq " Jeff Sullivan
  0 siblings, 2 replies; 4+ messages in thread
From: Stas @ 2001-05-29 21:30 UTC (permalink / raw)


    Hi!

Today I am install gcc 2.95.3 package on my alphastation and
run g++ compiler benchmark ftp://ftp.kai.com/pub/benchmarks/stepanov_v1p2.C
Then I am compile this benchmark with compaq C++ and get following results.
Description of tests available in the source file.

Config:
 Digital AlphaStation 500/400 256M
 Firmware revision: 7.2
 PALcode: UNIX version 1.22
 Compaq Tru64 UNIX V5.1 (Rev. 732)

g++:
 gcc version 2.95.3 20010315 (release)
 compile command: g++ -O2 -o stepanov.GCC stepanov_v1p2.C
 ./stepanov.GCC
test      absolute   additions      ratio with
number    time       per second     test0

 0        0.65sec    76.93M         1.00
 1        0.78sec    63.83M         1.21
 2        0.78sec    63.83M         1.21
 3        0.80sec    62.50M         1.23
 4        0.78sec    63.83M         1.21
 5        0.78sec    63.83M         1.21
 6        0.78sec    63.83M         1.21
 7        0.78sec    63.83M         1.21
 8        0.78sec    63.83M         1.21
 9        0.78sec    63.83M         1.21
10        0.78sec    63.83M         1.21
11        0.78sec    63.83M         1.21
12        0.78sec    63.83M         1.21
mean:     0.77sec    64.65M         1.19

Total absolute time: 10.07 sec

Abstraction Penalty: 1.19


cxx:
 Compaq C++ V6.3-010 for Compaq Tru64 UNIX V5.1 (Rev. 732)
 Compiler Driver V6.3-010 (cxx) cxx Driver
 compile command: cxx -o stepanov.Q -O4 -fast stepanov_v1p2.C -lm
 ./stepanov.Q
test      absolute   additions      ratio with
number    time       per second     test0

 0        0.25sec    200.01M         1.00
 1        0.35sec    142.86M         1.40
 2        0.97sec    51.73M         3.87
 3        0.82sec    61.23M         3.27
 4        2.02sec    24.79M         8.07
 5        0.83sec    60.00M         3.33
 6        2.10sec    23.81M         8.40
 7        0.83sec    60.00M         3.33
 8        2.08sec    24.00M         8.33
 9        0.83sec    60.00M         3.33
10        2.05sec    24.39M         8.20
11        0.82sec    61.23M         3.27
12        2.08sec    24.00M         8.33
mean:     1.02sec    49.21M         4.06

Total absolute time: 16.03 sec

Abstraction Penalty: 4.06




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

* Comapq C++ optimizer weakness
  2001-05-29 21:30 Comapq C++ optimizer weakness Stas
@ 2001-05-30  7:47 ` Tobias Ernst
  2001-05-31 21:53 ` Compaq " Jeff Sullivan
  1 sibling, 0 replies; 4+ messages in thread
From: Tobias Ernst @ 2001-05-30  7:47 UTC (permalink / raw)


Hallo Stas!

 S> g++:
 S> Abstraction Penalty: 1.19

 S> cxx:
 S> Abstraction Penalty: 4.06

Interesting. I did some tests on my own. I used an XP1000 workstation 
with g++ 2.95.2, cxx 6.3-001 and KCC 4.0a1

Of course, the Abstraction Penalty was 1.0 for KCC (guess where the 
benchmark comes from <g>). With gcc, I also did get 1.0. I wonder why 
g++ 2.95.2 should optimize better than g++ 2.95.3, but it seems it 
does. Maybe you also just ran the g++ test while your machine was not 
100% idle.

With cxx and the compiler options you posted I got the same devastating 
results (4.18 at my system). However, by experiment I found out that if 
I add the "-model ansi" option to cxx, it gest nearly as good as the 
other ones, with an Abstraction Penalty of 1.04, and ratios different 
from 1.00 only for test 3 and 10.

Perhaps anycone can comment on why "-model ansi" so dramattically 
improves performance for this benchmark?

Should we generally add "-model ansi" to improve performance, or is 
this benchmark just written in a way that by accident "-model ansi" is 
faster for this benchmark?

Viele Gr��e,
Tobias



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

* Re: Compaq C++ optimizer weakness
  2001-05-29 21:30 Comapq C++ optimizer weakness Stas
  2001-05-30  7:47 ` Tobias Ernst
@ 2001-05-31 21:53 ` Jeff Sullivan
  2001-05-31 21:57   ` Jeff Sullivan
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Sullivan @ 2001-05-31 21:53 UTC (permalink / raw)


I asked the Compaq C++ team about this and got the following reply:

We consistently test our compilers on the Stepanov benchmark internally,
and have for at least the past two years been able to produce low
abstraction penalties in the range of 1.00 - 1.04.  However, to 
obtain this penalty, we require that you add two more options
-tused and -inline all.  -tused asks the compiler to add the template
instantiations into the object file (as opposed to creating them
in a repository which is the deault) and -inline all helps fine-tune
our internal inlining heuristics.

With these two additional options, this is what I see:

> a.out

test      absolute   additions      ratio with
number    time       per second     test0

 0        0.20sec    250.01M         1.00
 1        0.20sec    250.01M         1.00
 2        0.22sec    230.78M         1.08
 3        0.20sec    250.01M         1.00
 4        0.22sec    230.78M         1.08
 5        0.20sec    250.01M         1.00
 6        0.22sec    230.78M         1.08
 7        0.20sec    250.01M         1.00
 8        0.22sec    230.78M         1.08
 9        0.20sec    250.01M         1.00
10        0.22sec    230.78M         1.08
11        0.20sec    250.01M         1.00
12        0.22sec    230.78M         1.08
mean:     0.21sec    240.94M         1.04

Total absolute time: 2.70 sec

Abstraction Penalty: 1.04

We are working on not requiring the user to add the two
additonal options, but we do not have a firm deadline on
this goal.

-model ansi is a new object model which produces objects
incompatible with objects generated from older C++ versions
(The default object model, -model arm, has limitations in its
design.  The new object model will allow us to be fully
compliant with the ANSI/ISO C++ standard).  We suggest that 
you use the -model ansi option only if you can recompile all 
your sources and libraries.  We have NOT specifically added
any optimizations exclusively to the new object model, such
that it produces code faster than the older one.  However, note 
that the new object model was designed to be more efficient than
model arm.


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

* Re: Compaq C++ optimizer weakness
  2001-05-31 21:53 ` Compaq " Jeff Sullivan
@ 2001-05-31 21:57   ` Jeff Sullivan
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Sullivan @ 2001-05-31 21:57 UTC (permalink / raw)


Another comment from the compiler team was this:

The "awful" Compaq CXX result from the original post occurred
partly because our baseline was so fast:

> g++:
>  gcc version 2.95.3 20010315 (release)
>  compile command: g++ -O2 -o stepanov.GCC stepanov_v1p2.C
>  ./stepanov.GCC
> test      absolute   additions      ratio with
> number    time       per second     test0
> 
>  0        0.65sec    76.93M         1.00
>  1        0.78sec    63.83M         1.21
>  2        0.78sec    63.83M         1.21
>  3        0.80sec    62.50M         1.23
>  :

> cxx:
>  Compaq C++ V6.3-010 for Compaq Tru64 UNIX V5.1 (Rev. 732)
>  Compiler Driver V6.3-010 (cxx) cxx Driver
>  compile command: cxx -o stepanov.Q -O4 -fast stepanov_v1p2.C -lm
>  ./stepanov.Q
> test      absolute   additions      ratio with
> number    time       per second     test0
> 
>  0        0.25sec    200.01M         1.00
>  1        0.35sec    142.86M         1.40
>  2        0.97sec    51.73M         3.87
>  3        0.82sec    61.23M         3.27
>  :

We're honestly slower on test 2, and nearly the same on test 3,
but it all looks worse because we're 2.5x as fast on the baseline
case.

Compiling without -O4 and -fast "fixes" that by slowing down the
baseline case.  Perhaps using the slightly-older g++ does the
same for them.


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

end of thread, other threads:[~2001-05-31 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-29 21:30 Comapq C++ optimizer weakness Stas
2001-05-30  7:47 ` Tobias Ernst
2001-05-31 21:53 ` Compaq " Jeff Sullivan
2001-05-31 21:57   ` Jeff Sullivan

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