🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
1 messages
1 total messages Started by David Koski Fri, 17 Apr 1992 20:22
super speed & gcc2.1
#741
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads