[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

building perl at -O3?



Background - Michael G Schwern observed that most linux distributions use
pretty much the default config on things they package. (IIRC he's using
debian-ppc). For him -O3 gives a speed boost over -O2, and he found it also
does on x86. Hence the appended config file tweak was added and will be in
5.8, which will default to -O3 on gcc on x86 and ppc.

I built the current development perl (5.7.2-and-a-bit) with
"gcc version 2.95.4 20010319 (Debian prerelease)" on arm and everything went
OK.
Regression tests ran a bit faster, but they're atypical code and mostly
forking. The perlbench benchmarking suite is plain odd, but seems to show
-O2 as a 5% gain over -O1, and -O3 as only a 4% gain over -O1.

Is it wise to add arm to the -O3 list for perl 5.8? Or is it safer to stay
at -O2? And does my strange un-speedup from -O2 to -O3 reflect a RiscPC's
slow memory and lack of L2 cache more than anything else?

Nicholas Clark

----- Forwarded message from Jarkko Hietaniemi <jhi@iki.fi> -----

Date: Thu, 29 Nov 2001 22:03:21 +0200
From: Jarkko Hietaniemi <jhi@iki.fi>
To: Nicholas Clark <nick@ccl4.org>
Cc: Michael G Schwern <schwern@pobox.com>, perl5-porters@perl.org
Subject: Re: [PATCH hints/linux.sh] Dirt cheap Linux optimization
Mail-Followup-To: Jarkko Hietaniemi <jhi@iki.fi>,
	Nicholas Clark <nick@ccl4.org>,
	Michael G Schwern <schwern@pobox.com>, perl5-porters@perl.org
User-Agent: Mutt/1.2.5i
In-Reply-To: <20011129200017.U37621@plum.flirble.org>; from nick@ccl4.org on Thu, Nov 29, 2001 at 08:00:18PM +0000

I recently added this to linux.sh:

case "$optimize" in
'') # If we have modern enough gcc and well-supported enough CPU,
    # crank up the optimization level.
    case "`${cc:-gcc} -v 2>&1`" in
    *gcc-2.95*|*gcc-3.*)
        case "`arch 2>&1`" in
        i?86|ppc) optimize='-O3' ;;
        esac
        ;;
    esac
    case "$optimize" in
    '') optimize='-O2' ;;
    esac
    ;;
esac

Tweak appropriately.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

----- End forwarded message -----



Reply to: