[svn:parrot] r48634 - in trunk: compilers/imcc src/pmc
Andy Dougherty
doughera at lafayette.edu
Wed Aug 25 21:12:01 UTC 2010
On Wed, 25 Aug 2010, chromatic wrote:
> On Tuesday 24 August 2010 at 10:14, plobsing wrote:
>
> > Author: plobsing
> > Date: Tue Aug 24 17:14:54 2010
> > New Revision: 48634
> > URL: https://trac.parrot.org/parrot/changeset/48634
> >
> > Log:
> > inline undocumented, used-once static functions
>
> Shouldn't a decent optimizing compiler inline used-once static functions? (I
> know there's often a size limit for this, but before we manually inline such
> functions I want to make sure we do so for good reasons.)
Yes, absolutely. Moreso, if directed by the proper optimization flags,
the compiler is usually able to make judgments about whether or not
inlining is wise. In looking at inline functions for perl5, I did some
tests on compilers ranging from an ancient 1996-era Sun Workshop 4.2
compiler up through Sun's 2010 compiler, as well as lots of versions of
gcc. Even without the inline keyword, all the compilers were already
inling some functions anyway. My conclusion: The compiler is usually
smarter than me. Strive for clarity of code instead. If the once-used
static function is a nice logical unit, then keep it as a nice logical
unit. Forcing it inline might actually make things worse on some systems.
--
Andy Dougherty doughera at lafayette.edu
More information about the parrot-dev
mailing list