develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #76438] peephole optimiser could prune more dead code

Thread Previous | Thread Next
From:
Ben Morrow
Date:
July 10, 2010 12:16
Subject:
Re: [perl #76438] peephole optimiser could prune more dead code
Message ID:
20100710191625.GA25534@osiris.mauzo.dyndns.org
Quoth fawaka@gmail.com (Leon Timmermans):
> On Sat, Jul 10, 2010 at 4:17 PM, demerphq <demerphq@gmail.com> wrote:
> >
> > I also proposed a "no magic" pragma/syntax that would allow the
> > optimiser to assume that all variables were "normal", and that funky
> > stuff wasnt going to occur during the scope of the pragma. And in such
> > a block i would expect this to block to be optimised away.
> 
> The use of magic is too pervasive for that. Not only because many
> special variables use active magic ($!, $1, %ENV, %SIG, etc…) but also
> autovivication, m//g state, tainting and utf8 caching, $#array, pos(),
> lvalue substr(), scalar(keys) and a number of more obscure things.
> 
> I don't think it's workable.

Most of those forms of magic don't have meaningful side-effects, though,
at least on mg_get. (That is, they may have side-effects, but it doesn't
matter if they aren't invoked. Tainting is the obvious exception.) This
is what really matters from the pov of optimisation.

Ben


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