🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #741

super speed & gcc2.1

#741
From: David Koski
Date: Fri, 17 Apr 1992 20:22
41 lines
1883 bytes
In one of the gnu.gcc groups there was mention that -fstrength-reduce (which
used to speed programs up quite a bit, although results varied by program)
did not do very good optimization.  I checked this out, and in fact
-fstrength-reduce (using gcc 2.1) really sucks.

I used dhrystone 1.1 to see what kind of difference it might make.  First,
I tried the old gcc (v 1.36, the one that comes with the system).
$OPT is a variable that turns on ALL optimization for cc.  $OPT2 turns
on ALL optimization (except loop unrolling) for gcc (v 2.1).  $LOOP2 turns
on loop unrolling.

gorgatron% cc $OPT dry.c
a.out
gorgatron% a.out
Dhrystone time for 500000 passes = 16
This machine benchmarks at 30581 dhrystones/second
gorgatron% gcc $OPT2 dry.c
gorgatron% a.out
Dhrystone time for 500000 passes = 13
This machine benchmarks at 36945 dhrystones/second

So, clearly gcc 2.1 generates better code.  Now let's try some stuff with
-fno-strength-reduce.

gorgatron% gcc -O -O2 -fno-strength-reduce dry.c
agorgatron% a.out
Dhrystone time for 500000 passes = 13
This machine benchmarks at 37831 dhrystones/second
gorgatron% gcc $OPT2 -fno-strength-reduce dry.c  
gorgatron% a.out
Dhrystone time for 500000 passes = 13
This machine benchmarks at 38071 dhrystones/second
gorgatron% gcc $LOOP2 $OPT2 -fno-strength-reduce dry.c
gorgatron% a.out
Dhrystone time for 500000 passes = 11
This machine benchmarks at 43041 dhrystones/second

43041! Not bad.  So turning strength reduction off seems to be a performance
win (at least for this program).

David Koski
Technical Details
Message-ID: <3644@caslon.cs.arizona.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!ncar!noao!arizona!dkoski

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!ncar!noao!arizona!dkoski
From: dkoski@cs.arizona.edu (David Koski)
Newsgroups: comp.sys.next.programmer
Subject: super speed & gcc2.1
Message-ID: <3644@caslon.cs.arizona.edu>
Date: 17 Apr 92 20:22:16 GMT
Organization: U of Arizona CS Dept, Tucson
Lines: 41