develooper Front page | perl.perl5.porters | Postings from December 2007

Re: optimising opcodes

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
December 30, 2007 08:16
Subject:
Re: optimising opcodes
Message ID:
b77c1dce0712300816s501d6901tbdf161a45796931@mail.gmail.com
On 29/12/2007, Jim Cromie <jim.cromie@gmail.com> wrote:
> > 5: How do you spot code executed only once, and avoid doing this?
> >    (main program, eval blocks, top level code from do/require/use,
> >     BEGIN/UNITCHECK/CHECK/INIT/END - ie basically anything not a "real"
> >     subroutine definition)
> >
> Why do you think it matters ?
> Is it just avoiding cpu cycles doing stuff that has low/no payoff ?
> or is is caution/paranoia, or a specific reason ?

I think that should be avoided, and apply the optimisation to all
optrees. If we start producing different optrees for the same source
code depending on whether it's in a special block or not, there is a
small chance that bugs appear in one case and not in the other ones,
and they'll be difficult to spot.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About